JSON Encode Online

Turn raw text into a valid JSON string literal, including the surrounding quotes and required escapes.

This is useful when you need a safe JSON string value to paste into payloads, fixtures, or config files.
Encoder
Text in; a quoted and escaped JSON string out
Encoded Output
The JSON string literal will appear here...

Input chars

0

Output chars

0

Escapes added

0

Returns a JSON string literal

Even text that looks like a number or boolean stays a string: entering 42 produces "42", and entering true produces "true".

Quotes inside text

Quotation marks within your text are escaped so they remain part of the string rather than ending it.

String focused by design

This tool encodes raw text into a JSON string value. For full objects and arrays, use the parser or formatter tools instead.

Related Tools