We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Process special character escaping and unescaping for HTML, URL, and JS formats. Perfect for web development and data processing tasks.
Enter text to view conversion results
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
This converter takes one text value and shows both an escaped and an unescaped result for the selected mode. Choose JavaScript, JSON, HTML, or URL. It is designed for common string representations: JavaScript mode handles backslashes, quotes, and selected control characters; JSON mode uses JSON string escaping; HTML mode replaces ampersand, angle brackets, quotation marks, and apostrophes with entities; URL mode encodes or decodes a URI component.
Escaping changes how characters are represented so text can fit a particular syntax. For example, JSON represents a newline inside a string with
, while URL component encoding represents reserved or non-ASCII characters with percent-encoded UTF-8 bytes. The output remains text; escaping is not encryption.
The URL mode uses component encoding, not whole-URL encoding. Use it for a value being placed inside a URL, such as one query parameter, rather than an entire address with its separators. The HTML mode encodes a short set of characters; it does not parse markup or sanitize unsafe content.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Enter or paste the string in the input area. The same input is processed into both output boxes, so you can inspect the encoded and decoded interpretations together.
Choose JSON for string content inside JSON, JavaScript for the supported quote and control-character escapes, HTML for the listed entities, or URL for an individual URI component. A value intended for a different context may need a different encoding rule.
Review the escaped result before inserting it elsewhere. The unescaped result is useful for reading an already escaped value. Copy the relevant box, and check that punctuation and line breaks survived the round trip.
Some invalid encoded sequences cannot be decoded. The URL decoder keeps the original input when decoding fails; JSON mode also falls back to the input on parse failure. Do not assume unchanged output means the text was valid for its intended destination.
Use cases
See how the tool fits into real work and everyday tasks.
Escape a text value that contains quotes, backslashes, or line breaks before placing it inside a JSON string. Keep the surrounding JSON punctuation and property names separate from the value.
Use URL mode on the parameter value alone, then place that encoded value into the appropriate URL position. Encoding an entire URL as though it were a single value can also escape structural separators.
Convert the supported special characters when preparing plain text for an HTML text context. For other contexts, including attributes or script blocks, use the context-specific safe handling recommended by your platform.
Q&A
Find concise answers to common questions and confusing cases.
No. It applies component encoding. Apply it to a value such as a query parameter, not to the full URL with its scheme, slashes, and separators.
No. The mode replaces five characters with entities, but it is not a sanitizer and does not account for every HTML, attribute, URL, or script context. Use context-aware output handling and validation.
The tool calculates both representations from the current input and selected mode. If the input is already escaped, inspect which result matches the destination format; escaping twice can produce a different string than intended.
Notes
Review scope, result limitations, and important precautions before use.
Do not treat an escaped string as encrypted or automatically safe in every context. HTML text, HTML attributes, JavaScript source, JSON strings, and URI components have different rules. This converter implements limited string transformations and is not a security filter, HTML sanitizer, URL validator, or substitute for safe parameterized APIs. Review the result in the context where it will be used.
Related
Discover related tools, collections, and available API capabilities.