Escape text for JSON strings or unescape JSON-encoded text
A JSON escape and unescape tool helps you safely encode raw text so it can be inserted into JSON strings without breaking JSON syntax. JSON strings must escape characters like quotes, backslashes, newlines, tabs, and other control characters using escape sequences such as \n, \t, \", and \\. This tool converts raw text into JSON-safe escaped strings (escaping) and also converts escaped JSON strings back into readable text (unescaping). It is essential for API payloads, logs, configuration files, and debugging JSON parsing issues.
Paste your text or JSON string into the input box
Click Escape/Unescape to process the input
If input contains raw quotes/newlines, it will escape them into JSON-safe sequences
If input contains escape sequences like \n or \", it will unescape back into readable text
Copy the output and use it safely in JSON payloads, APIs, or code
Fix JSON Parse Errors: Escape problematic strings that break JSON format
Store User Text Safely: Encode user messages before inserting them into JSON fields
Debug API Payloads: Quickly inspect escaped JSON strings from API responses
Prepare Logs & Strings: Convert multi-line text into JSON-safe single-line strings
Escape Windows Paths: Convert backslashes into valid JSON strings
Converts raw text to JSON-safe format and decodes JSON strings back to text
Avoids broken payloads caused by quotes and control characters
Supports quotes, backslashes, newline, tab, carriage return, and more
Fast results without needing libraries or scripts
Copy output instantly for use in APIs and code
Everything runs locally in your browser