跳转到主要内容
CuteJSON
↑↓ 导航 Enter 选择 Esc 关闭

JSON to NDJSON Converter

Turn an array into one JSON value per line for a log or a stream, and turn those lines back into an array.

返回所有工具

键盘快捷键

这些快捷键在页面上对应操作存在时有效。

打开命令面板
Ctrl/Cmd + K
运行主要操作
Ctrl/Cmd + Enter
格式化
Ctrl/Cmd + Shift + F
压缩
Ctrl/Cmd + Shift + M
复制输出
Ctrl/Cmd + Shift + C
打开文件
Ctrl/Cmd + Shift + O
下载输出
Ctrl/Cmd + S
关闭此对话框
Esc
打开此对话框
F1 / ?

本地数据

以下所有内容仅存储在此浏览器、此设备上。

未保存的草稿
记住选项的工具

最近打开的文件

    此设备上尚未打开任何文件。

    通过链接分享

    内容被打包在链接 # 号之后的部分。

    分享此页面上的第一个输入。

    暂无可分享的内容。

    JSON

    从 URL 加载

    直接从浏览器获取 URL。

    NDJSON

    结果将显示在此处。

    Batch validation

    A report on the JSONL in the left pane, whichever direction is selected. Nothing here changes the document.

    完全在您的浏览器中运行。

    关于此工具

    NDJSON is one JSON value per line, and that is the whole format. It exists because a reader can handle a line and forget it, which is what makes a log file or a large export streamable when a single enormous array is not. Any JSON value is allowed on a line, not only an object, and no line is indented, because a line break inside a value would end the record. This tool skips a completely blank line rather than failing on it, since almost every file ends with a newline, and it reports a line that does not parse by the number it has in your file rather than by a position in some rewritten document. That skip is the default; the Blank lines option can treat a blank line as a failure instead. Keep valid lines changes what a bad line does to the rest of the file: instead of stopping the conversion, every line is judged on its own, the lines that parse build the result, and the lines that do not are listed with their line number and reason. Both directions go through the token stream, so a twenty digit integer comes back with all twenty digits. Batch validation, below the converter, is a separate report rather than a conversion: it checks every record on its own against an optional JSON Schema, checks for required fields, finds duplicate values in one chosen ID field, and compares every record's keys and types against whichever shape most records actually have, without changing the document.

    使用方法

    1. Choose a direction, then paste your document into the left pane or load the sample.
    2. Press Convert. Going to NDJSON needs an array, since that is the JSON shape that is a sequence of values.
    3. Copy the result or download it. Any line that does not parse is reported with its line number.