Escape text as a JSON string literal by encoding quotes, backslashes, newlines, and special characters.
Escape JSON String is a free online tool that converts plain text into a valid JSON string literal by escaping quotes, backslashes, newlines, tabs, and other special characters. It can also unescape a JSON string back to readable text. The tool runs in your browser and does not send data to the server.
Choose a related tool for the next step.
Data passed between tools is kept only in the current browser session.
Escape JSON String converts plain text into a valid JSON string literal. It escapes double quotes, backslashes, newline characters, tabs, carriage returns, and other control characters so the string can be safely embedded inside a JSON payload.
The tool can also perform the reverse operation: unescape a JSON string and display the original plain text. This is useful when manually assembling API requests, payloads, logs, configs, test data, and documentation where errors like Unexpected token occur because of unescaped quotes or newlines.
All processing is done locally in the browser. Your data is not sent to the server.