JSON String Escape / Unescape
Escape and unescape strings for JSON. Safely convert special characters like newlines and double quotes, all processed inside your browser.
How to Use
Choose a Mode
Select "Escape" or "Unescape". Escape converts a normal string for JSON, while Unescape restores a JSON string back to plain text.
Enter Your String
Type or paste text into the input field and the result appears in real-time on the right (or below on mobile).
Adjust Options
When escaping, choose whether to add surrounding double quotes. Enable it when you want to paste the result directly as a JSON value.
Copy the Result
Click the copy button to copy the output with one click and paste it into your code or config file.
About JSON String Escaping
JSON string escaping converts special characters such as newlines, tabs, double quotes ("), and backslashes (\) into JSON-compliant sequences (\n, \t, \", \, etc.). This lets you safely embed any text as a JSON value. This tool processes everything in your browser with JavaScript, so your text is never sent to a server.
Features
- Two-way ConversionSupports both escape and unescape. Swap the direction with one click.
- Real-time ProcessingSee the result instantly as you type. No waiting required.
- Quote OptionChoose to include or omit the surrounding double quotes to fit your use case.
- Privacy ProtectedAll processing happens in your browser. Text is never sent to servers.
Use Cases
- Embed strings with newlines or quotes into JSON values
- Put long text into an API request body
- Write sentences or paths into a JSON config file
- Restore escaped strings from logs or JSON responses for readability
- Create and verify string literals in your code
FAQ
Is the JSON string escape tool free to use?
Which characters are escaped?
What is the surrounding quotes option for?
Why does unescape fail?
Is my text sent to a server?
Feedback
Missing a feature, or getting a result that looks wrong? Let us know — we improve our tools based on your feedback.