JSON to One Line
Collapse a JSON document onto a single line while keeping it valid.
Input
Output
Ready
Drop a file to load it
About this tool
Put an entire JSON document on one line. Functionally the same as minifying, and the usual reason is a destination that treats newlines as a record separator — log lines, CSV cells, or single-line form fields.
When you would use it
- Writing structured logs where each entry must be one line
- Putting JSON inside a CSV cell
- Passing a payload as a single shell argument
Worked example
{
"level": "error",
"msg": "failed"
}
{"level":"error","msg":"failed"}
Things worth knowing
- Newlines inside string values are escaped as
\nrather than removed, so no data is lost.
Questions
Frequently asked
Is this different from minifying?
The output is identical. The two tools exist separately because people look for them by different names.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related