← Text & List Tools
Text & List Tools · runs locally

JSON String Literal Encoder and Decoder

Create a valid quoted JSON string literal from text or strictly decode one literal without evaluating code.

Ready. Your working data stays in this browser.

Why this tool is useful

Use this codec when placing user-visible text, line breaks or Unicode inside JSON configuration, API examples and deterministic test data.

How it works

Encoding delegates to the JSON string grammar; decoding uses JSON parsing and rejects numbers, objects, arrays and trailing content instead of executing input.

Practical example

A line break becomes backslash-n and embedded double quotes become backslash-quote inside one valid JSON string.

Validation

The calculation is deterministic and explains validation errors instead of silently changing invalid input.

Privacy boundary

Input and output remain in this tab. Copy and download happen through browser APIs without a server upload.

Result passport

Every run reports its tool mode, timestamp and input/output size so transformed data can be audited.