代码、数据与二维码工具

JSON序列化为字符串

JSON序列化为字符串;输入、输出与参数范围在实施前细化。

优先本地处理无需注册隐私说明 ↗

Standard JSON only, up to 2 MB. Processing stays in your browser.

Paste JSON to begin.

使用步骤

如何使用

  1. Paste valid JSON up to 2 MB into the editor.
  2. Optionally sort object keys or wrap the compact result as a JSON string literal.
  3. Stringify the input, then copy or download the result.

Compact JSON output

The tool parses your complete document and serializes it with JSON.stringify, removing insignificant whitespace while preserving strings, numbers, arrays, objects, booleans, and null.

Stable keys when needed

Enable Sort object keys to recursively order object keys with a predictable, locale-independent comparison. Array order is always preserved.

Local and bounded

Parsing, stringification, copying, and downloads happen locally in your browser. Input is limited to 2 MB, and comments, trailing commas, NaN, and Infinity are rejected as invalid JSON.

常见问题

你可能还想知道

Does stringifying change my JSON values?

No. It removes insignificant whitespace and serializes the parsed JSON. Array order and value types remain unchanged.

What does JSON string literal mode do?

It wraps the compact JSON text in JSON quotes and escapes it, which is useful when embedding JSON inside another JSON value or source string.

Can I use comments or trailing commas?

No. The tool accepts standard JSON only, so remove comments and trailing commas first.

Is my JSON uploaded?

No. Processing runs locally in your browser.