JSON Escape
Escape reserved characters so any piece of text can be dropped into a JSON string value without breaking it.
Your data stays on your device
Input — Text
- characters
- 0
- lines
- 0
- size
- 0 B
Output — Escaped
- characters
- 0
- lines
- 0
- size
- 0 B
About this tool
A JSON string cannot contain a raw double quote, backslash, tab or newline — those characters must be escaped. This tool takes arbitrary text and returns the escaped form, ready to paste between the quotes of a JSON string.
Unlike stringifying, it does not add the surrounding quotes, so you can insert the fragment into an existing string you are building by hand.
How to use this tool
- Paste the raw text you want to place inside a JSON string.
- Press Escape to convert the reserved characters.
- Insert the escaped fragment between the quotes in your JSON.
- Use JSON Unescape to reverse the operation.
Key features
- Escapes quotes, backslashes, tabs, newlines and control characters
- Returns a fragment without surrounding quotes
- Reversible with JSON Unescape
- Handles Unicode text correctly
- No upload — runs in your browser
Example
Input — Text
She said "hi"
Path: C:\tmpOutput — Text
She said \"hi\"\nPath: C:\\tmpGood to know
- It escapes text, not JSON structure. To embed a whole JSON document, use JSON Stringify.
- Only JSON escape rules are applied; other encodings such as URL or HTML are separate tools.
Frequently asked questions
When do I need to escape text for JSON?
Whenever you are hand-building a JSON string that contains quotes, backslashes or line breaks — for example a message or a file path.
Why are there no surrounding quotes in the output?
So you can paste the fragment into an existing string. Use JSON Stringify if you want the quotes included.
Does it upload my text?
No. Escaping is done locally.
Your data stays on your device
Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.