String Escape / Unescape — Free Online Character Escape Tool

Free online string escape and unescape tool. Instantly escape or unescape special characters — quotes, newlines, tabs, backslashes — for JSON, JavaScript, SQ...

To escape a string, select Escape, choose JavaScript or JSON and paste your text; quotes, backslashes, tabs and line breaks become escape sequences. Select Unescape to turn them back into raw characters.

Last updated:

String Escape / Unescape — Free Online Character Escape Tool. Free online string escape and unescape tool. Instantly escape or unescape special characters — quotes, newlines, tabs, backslashes — for JSON, JavaScript, SQL and more. 100% private, browser-based.

Instantly escape or unescape special characters in any string with our free string escape / unescape tool online.

This essential developer utility encodes characters like double quotes, single quotes, newlines (\n), tabs (\t), carriage returns (\r), and backslashes for safe use in JSON payloads, JavaScript source code, SQL queries, and configuration files.

Whether you are a backend engineer sanitizing database input, a frontend developer preparing API request bodies, or a QA engineer encoding test data, our escape special characters tool handles the job instantly.

Simply paste your raw string, select Escape or Unescape, and copy the result.

Our string escape and unescape tool processes all input entirely in your browser — your API keys, database connection strings, and sensitive configuration values are never transmitted to a server.

All character escaping and unescaping runs locally using client-side JavaScript, making this the safest way to handle escape characters online.

The parser handles all common escape sequences: \\ for backslash, \" for double quote, \' for single quote, \n for newline, \r for carriage return, and \t for tab. No installation, no account, no upload required.

Frequently asked questions

How do I escape special characters in a string?

Select Escape at the top, pick the JavaScript or JSON format, then paste your text into Input String. The Result box shows the escaped version immediately; click Copy to copy it. This is useful for putting multi-line text or text with quotes inside a string literal.

Which characters does the escape tool change?

In JavaScript format: a backslash becomes two backslashes, line breaks, carriage returns and tabs become backslash n, r and t, and double and single quotes get a backslash in front. In JSON format single quotes are left alone and other control characters become backslash u escapes. Other characters, including Unicode, stay unchanged.

How do I unescape a string?

Select Unescape and paste the escaped text. The text is read once from left to right, so a double backslash always becomes one backslash and an escaped Windows path such as C:\\new becomes C:\new rather than C: followed by a line break. Backslash n, r, t, b, f, v, 0, quotes and slashes are decoded too.

Can I use the escaped result in JSON?

Yes, choose the JSON format. It escapes exactly what JSON requires, double quotes, backslashes and control characters, and never adds a backslash before a single quote, so the result can be placed between double quotes and parsed as JSON. The JavaScript format escapes single quotes too, which JSON does not allow.

Does it decode Unicode escapes or HTML entities?

Unicode escapes yes: Unescape decodes backslash-u escapes with four hex digits or braces, including surrogate pairs for emoji, and backslash-x escapes with two hex digits. HTML entities such as amp are not decoded; use an HTML entities tool for those.

What happens to unknown escape sequences?

A backslash followed by a character that is not a known escape, for example backslash q, or an incomplete sequence such as backslash u12, is kept exactly as typed, backslash included, so nothing is silently lost.

How to use this online tool

String Escape / Unescape — Free Online Character Escape Tool is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.

Private processing in your browser

String Escape / Unescape — Free Online Character Escape Tool keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.

When this tool is useful

Use String Escape / Unescape — Free Online Character Escape Tool for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.

Practical tips

Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.