JSON Formatter
Paste JSON and format it, shrink it, or check it for errors, with the exact line of the problem.
Open tool →Paste CSV data with a header row and get clean JSON back in seconds. Copy the result or download it as a .json file, ready to use in code.
Last updated: 17 November 2026.
The first row is read as the header row. Everything runs in your browser, so your CSV is never uploaded, sent, or stored.
CSV and JSON are two of the most common ways to store a table of data, and they solve the same problem in different ways. CSV, short for comma separated values, stores a table as plain text, with one record per line and one field per column. JSON, short for JavaScript Object Notation, stores the same table as a list of objects, where every value has a name attached to it. Converting CSV to JSON means reading each row of the table and turning it into an object, using the header row as the field names. The data stays the same, only the shape changes, so code can read it directly.
This is a daily task for developers. A spreadsheet export, a data download from a website, or a list sent by a client often arrives as CSV, while the app that needs the data expects JSON. Doing the conversion by hand is slow and error prone, so a small converter does it in seconds and keeps every value in the right field, ready to paste into a script, a test file, or an API request.
The main reason is that code works with objects, not with text lines. In JavaScript, Python, and most other languages, a JSON array of objects can be loaded and used at once, with each field reached by name. A CSV file has to be parsed first, split on commas, and matched to headers by hand, which is extra work and a common source of bugs. Converting once, up front, keeps the rest of the code simple.
JSON is also easier to pass around between systems. An API that accepts a list of users will usually expect JSON in the request body, not a CSV attachment. A test suite that checks how an app handles data will usually feed it JSON too. When the source data lives in a spreadsheet, this converter is the short step between the table you can see and the format your code can use.
Start by pasting your CSV into the left box. The first row must be the header row, with the field names separated by commas, such as name,age,city. Every row after that is one record, with values in the same order as the headers. Then choose an output style. Pretty JSON spreads the result over many lines with two space indentation, which is easy to read and check. Compact JSON puts everything on one line, which is better when you need to paste it into a small space or send it in a request.
Press Convert to JSON and the result appears in the dark output panel on the right. The counters above show how many rows and columns were read, so you can check that nothing went missing. Press Copy JSON to copy the whole result, or Download .json to save it as a file. The Load sample button fills in a small example so you can see how the tool works before you paste your own data, and Clear empties both boxes. Nothing you paste leaves your browser at any point.
Real CSV data is messier than the simple examples. A value can contain a comma, such as a company name like "Smith, Jones and Co", or a quote, or even a line break inside an address. This converter follows the standard CSV rules for those cases. A value wrapped in double quotes is read as one field, even if it holds commas or line breaks, and a doubled quote inside it becomes a single quote in the result. That is why quoted values survive the trip into JSON without splitting into extra fields.
Empty cells are kept as empty strings, so a missing value does not shift the rest of the row. Values that look like numbers, such as 30 or 4.5, are turned into real numbers in the JSON, and the words true and false become real booleans, which keeps the output useful in code. If a row has fewer values than the header, the missing fields are filled with empty strings, and if it has more, the extras are ignored, so one uneven row cannot break the whole conversion.
The most common problem is a missing or uneven header row. If the first row is data rather than names, the converter will treat those values as field names and the result will look wrong. Add a header row first, with one clear name per column, and avoid duplicate names, because two columns with the same name would overwrite each other in the JSON.
Another common problem is a file that uses semicolons instead of commas, which some spreadsheet apps produce in countries where a comma is the decimal mark. If your rows all land in a single field, that is usually the cause, so re-export the file with commas, or replace the semicolons before you paste. If the output looks right but a value still seems off, the JSON formatter can tidy the result and show the exact line of any problem. To check a file before and after a change, the text diff checker highlights exactly which lines moved.
Yes. The first row is read as the field names, and every row after it becomes one JSON object with those names as keys. If your data has no header row, add one first, such as name,age,city, before you paste it in.
Values that look like numbers, such as 30 or 4.5, become real numbers in the JSON, and the words true and false become booleans. Empty cells stay as empty strings, so a missing value never shifts the rest of the row.
Fields wrapped in double quotes are read as a single value, even if they contain commas or line breaks. A doubled quote inside a quoted field becomes one quote in the result, following the standard CSV rules.
Yes. Use the Compact JSON button before you convert. It puts the whole result on one line, which is handy for pasting into a small space or sending in an API request. Pretty JSON is the default because it is easier to read.
No. The conversion runs fully in your browser with plain JavaScript. Your CSV is never uploaded, never sent to a server, and never stored. You can close the page and nothing remains.