Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
String Escape/Unescape

String Escape/Unescape

Escape and unescape strings for JSON, XML, SQL, JavaScript, Python, C/Java, CSV, RegEx, and Shell with real-time conversion.

Escape String Online for Any Language

Escape string online turns special characters into safe representations you can drop straight into code, queries, or data files without breaking the syntax. Unescape reverses it, restoring the original text from its escaped form. It is built for developers who paste a value into JSON, SQL, JavaScript, or a regex and need it correctly escaped in one step.

The tool covers 9 formats — JSON, XML, SQL, JavaScript, Python, C/Java/C#, CSV, RegEx, and Shell/Bash — each following the proper escaping rules for that language or standard. Pick a format, choose Escape or Unescape, and the result appears as you type.

Private by design: every conversion runs entirely in your browser. Your text is never uploaded to a server, so it is safe for API keys, credentials, and other sensitive strings.

How to Escape or Unescape a String

1

Choose a format

Open the format dropdown and pick your target — JSON, XML, SQL, JavaScript, Python, C/Java/C#, CSV, RegEx, or Shell/Bash.

2

Select a mode

Click Escape to encode special characters, or Unescape to decode an already-escaped string back to plain text.

3

Type or paste your text

Enter text in the input panel on the left. The converted result appears instantly in the output panel on the right, with a character count for both sides.

4

Copy the result

Press the Copy button to put the output on your clipboard. Use Swap to send the output back to the input and flip the mode, or Clear to reset both panels.

Features

9 Formats

Escape and unescape for JSON, XML, SQL, JavaScript, Python, C/Java/C#, CSV, RegEx, and Shell/Bash, each with the correct rules.

Escape & Unescape Modes

Toggle between encoding special characters and decoding an escaped string back to its original text.

Real-Time Conversion

The result updates as you type. Conversion is debounced for smooth performance even when you paste large blocks of text.

Escape Reference Table

A built-in table lists every escape sequence for the selected format, each with a description and example. Click any row to copy the sequence.

Swap & Round-Trip

One click moves the output into the input and flips the mode, so you can verify that escaping and unescaping return the original text.

Copy & Clear

Copy the result to your clipboard in one click, or clear both panels to start fresh.

Character Count

A status bar shows the character length of both the input and the output so you can see how escaping changes the size.

Unicode & Control Characters

Handles quotes, backslashes, control characters, and Unicode escapes such as \uXXXX so tricky symbols convert correctly.

Frequently Asked Questions

What does it mean to escape a string?

Escaping converts characters that have a special meaning in a language into a safe representation so they do not break the surrounding syntax. For example, a double quote becomes \" inside a JSON string. Unescaping does the reverse, turning the escaped form back into the original character.

How do I escape a JSON string?

Select JSON from the format dropdown, leave the mode on Escape, and paste your text. The tool escapes double quotes, backslashes, newlines, tabs, and control characters into the \u form, ready to drop inside a JSON value.

What is the difference between JSON escape and JavaScript escape?

JSON only allows double-quoted strings, so it escapes " but not single quotes. JavaScript supports single quotes, double quotes, and backticks, so its rules also escape ' and ` and add sequences like \x. Switching the format applies the correct rule set for each.

How do I unescape a string?

Pick the matching format, click Unescape, and paste the escaped text. The tool reads sequences like \n, \t, and \uXXXX and restores the original characters. Use Swap to round-trip a value and confirm it matches the source.

Why does the same text produce different results in different formats?

Each format defines its own special characters and escape syntax. A single quote becomes '' in SQL but \' in JavaScript, and an ampersand becomes & in XML. Open the Escape Reference panel to see the full sequence list for the format you have selected.

Which languages and formats does it support?

Nine formats are supported: JSON, XML, SQL, JavaScript, Python, C/Java/C#, CSV, RegEx, and Shell/Bash. Each uses the escaping conventions of its language, so the output is ready to paste directly into your code or query.

Is my data sent to a server?

No. All escaping and unescaping happens locally in your browser with JavaScript. Nothing you type is transmitted or stored anywhere, so it is safe to use with sensitive strings like passwords, tokens, and private data.

Input
Escaped
Sequence Description Example
Select a format from the dropdown to match your target language
Click Swap to quickly reverse the conversion direction
Open the Escape Reference panel to see all escape sequences for the selected format
Click any row in the reference table to copy the sequence
All processing happens in your browser — no data is sent to any server
Want to learn more? Read documentation →
1/6
Start typing to search...
Searching...
No results found
Try searching with different keywords