String Escape / Unescape
Escape and unescape strings for JavaScript, JSON, HTML entities, URL encoding, and RegEx.
Escape and unescape strings online: JavaScript, JSON, HTML, and URL
Special characters can break parsers, markup renderers, and URL handlers if they are not properly encoded. This tool lets you escape and unescape strings for the most common developer contexts: JavaScript string literals, JSON values, HTML documents, and URL query parameters: without writing a single line of code.
Whether you need to embed a user-supplied string safely inside a script tag, encode a URL parameter that contains spaces or punctuation, or decode an escaped value back to human-readable form, the tool handles it instantly in your browser with no server involvement and no data retention.
Step-by-step guide
- 1Paste your string
Enter or paste the text you want to escape or unescape into the input field. - 2Choose the mode
Select whether you want to Escape (encode special characters) or Unescape (decode them back). - 3Select the encoding format
Pick the target format: JavaScript, JSON, HTML entities, or URL percent-encoding. - 4Review the output
The converted string appears instantly in the output panel as you type or change options. - 5Copy the result
Click Copy to grab the escaped or unescaped string and use it in your code or document.
Related Tools
CSV → JSON
Convert comma-separated data to JSON arrays with automatic header detection.
JSON → CSV
Convert JSON arrays of objects to CSV with automatic column extraction.
JSON → XML
Serialize JSON objects to well-formed XML with configurable root element.
XML → JSON
Parse XML documents to JSON with attribute and text node preservation.
Frequently Asked Questions
- What does string escaping mean?
- Escaping converts special characters into sequences that are safe to embed in a specific context. For example, a double-quote inside a JSON string becomes \" so the parser doesn't interpret it as the end of the string.
- When would I need to escape a string for JavaScript?
- Any time you are building a string literal in JavaScript code that contains quotes, backslashes, newlines, or other control characters that would otherwise break the syntax.
- What is the difference between HTML escaping and URL encoding?
- HTML escaping replaces characters like <, >, &, and quotes with named entities (e.g. &) so they display correctly in HTML. URL encoding replaces characters with percent-sequences (e.g. space becomes %20) so they are safe in a URL.
- Is the conversion done server-side?
- No. Everything runs in your browser. Your strings are never sent to any server.
- Can I unescape an already-escaped string?
- Yes. Switch to Unescape mode and paste an escaped string to decode it back to the original plain text.
- What characters are escaped in JSON mode?
- JSON mode escapes double quotes, backslashes, and control characters such as newline, tab, carriage return, and other non-printable Unicode characters below U+0020.
- Does URL encoding change spaces?
- Yes. In standard percent-encoding, a space becomes %20. Some contexts use the + sign for spaces instead, which is common in form data encoding (application/x-www-form-urlencoded).
- Is this tool free?
- Yes, completely free with no sign-up, no account, and no usage limits.
AlteredIdea vs alternatives
vs server-side converters: AlteredIdea converts in your browser: your data never leaves your device.
vs writing scripts: Instant results, no coding needed.
vs paid tools: Completely free, no account required.