JSON Stringify

Generate a safe, quoted JSON string from any object or array.

How it works

The tool serializes the parsed value and escapes quotes, newlines and control characters so the output can be pasted directly into source code.

Example