MASK

Free with a MASK account

CSV to JSON Converter

Convert between CSV and JSON, including the awkward quoted fields.

Runs entirely in your browser — what you enter is never sent to MASK. Your account records that you used this tool, along with which direction you ran it in, how many items you produced and how long your input was — never what you entered.

Both directions run here in your browser.

Quoted values may contain commas, doubled quotation marks and line breaks. 0 of 1,000,000 characters.

On: each row becomes an object keyed by the first row. Off: each row becomes an array.

Questions

My CSV has commas inside the values. Will that break it?
No. A value wrapped in quotation marks may contain commas, quotation marks (written as two in a row) and even line breaks, and this converter reads all three correctly — it walks the file character by character rather than splitting on commas, which is what makes an address field like "Doe, John" stay one value instead of becoming two.
What happens to a row with the wrong number of columns?
It is kept, not dropped. A row with fewer values than the header gets empty strings for the columns it is missing; a row with more keeps the extra values under generated column_N keys. Either way the converter tells you how many rows it had to do this for, so you can go and look.
Why did a value starting with = get an apostrophe in front of it?
Because spreadsheets treat a cell beginning with =, +, - or @ as a formula to run, not as text — which is how a CSV can carry something unpleasant into Excel or Google Sheets. The apostrophe marks it as text. Plain negative numbers are left alone, and you can switch the behaviour off if the file is not headed for a spreadsheet.
Does my data get uploaded anywhere?
Your CSV and your JSON are never sent to MASK. The conversion runs in your browser on this page, and there is no field in anything this page sends that could carry a row of it. It does talk to MASK for two things, neither of which is a row of your data: to check whether you are signed in, and to record on your account that you used this converter, which direction you ran it in, how long the input was and how many rows came out. That is also why it needs a connection: offline, the sign-in check cannot complete, so the converter does not run.
What about Windows line endings and BOMs?
A byte-order mark at the start is removed, and CR LF, CR and LF line endings are all understood, including inside quoted values. Output is written with LF line endings.