UTILITIES NEWBIE

JSON document to JSON string

Encode a complete JSON document as the contents of one JSON string value.

Source

0 characters

Import a local UTF-8 file
Print and optional local draft

An explicit save stores only source text as plaintext in this browser on this device. Do not save secrets or use a shared device. Nothing is saved or loaded automatically.

No draft has been loaded.

Output

Worked input and output

Input

{"name":"Ada"}

Output

"{\"name\":\"Ada\"}"

The document is compacted first, then its quotes are escaped inside a new JSON string. This is JSON encoding, not a JavaScript expression or general language-specific escaping.