CSV to JSON Converter
Convert CSV files to JSON arrays online. Paste or upload your CSV and download the result as a .json file. Free, private, runs in your browser.
This CSV to JSON converter transforms comma-separated values into a JSON array of objects. The first row provides the keys; each subsequent row becomes one object. Commas, tabs, and semicolons are detected automatically. Click Convert to parse, then Download JSON to save converted.json. Everything runs locally—your data never leaves your browser.
How to convert CSV to JSON
- Paste or upload your CSV — Type or paste CSV text into the left panel, or click Upload CSV to select a
.csvor.txtfile from your device. - Click Convert — The converter parses your CSV and displays the resulting JSON array in the right panel.
- Copy or download — Click Copy to copy the JSON to your clipboard, or Download JSON to save it as
converted.json.
Need the reverse? Use the JSON to CSV converter to turn JSON arrays back into CSV files.
Convert CSV to JSON in JavaScript
Using Papa Parse (recommended)
Papa Parse is a fast CSV parser that works in browsers and Node.js. With header: true, the first row becomes object keys:
import Papa from 'papaparse';
const csv = `name,age,city
Ada,30,London
Bob,25,Paris`;
const result = Papa.parse(csv, {
header: true,
skipEmptyLines: true,
dynamicTyping: true
});
console.log(result.data);
// [{ name: "Ada", age: 30, city: "London" },
// { name: "Bob", age: 25, city: "Paris" }]Minimal split-based approach
For simple CSVs without quoted fields, you can split on newlines and commas. This does not handle commas inside quotes, escaped quotes, or multi-line fields:
function simpleCsvToJson(csv) {
const lines = csv.trim().split('\n');
const headers = lines[0].split(',');
return lines.slice(1).map(line => {
const values = line.split(',');
return headers.reduce((obj, key, i) => {
obj[key] = values[i];
return obj;
}, {});
});
}
// Caveat: fails on "Ada,""nickname"",London" or
// fields containing commas. Use Papa Parse for
// production code.Node.js with csvtojson
The csvtojson package reads CSV files and streams in Node.js:
import csvtojson from 'csvtojson';
// From file
const json = await csvtojson().fromFile('data.csv');
// From string
const json2 = await csvtojson().fromString(csvText);CSV to JSON in Python
The snippet below reads the first row as object keys with CPython csv.DictReader (stdlib csv module, excel dialect) and prints a JSON array with json.dumps. That is the same header-row → array-of-objects shape this page returns. It is not Papa Parse, and Node has no stdlib CSV parser — the csvtojson example above is an npm package. csvkit csvjson samples are in CSV to JSON in the shell below. For the reverse direction, see JSON to CSV converter.
Python with csv.DictReader
Pass a file opened with newline='' (or io.StringIO) so the csv module owns line endings. Omit fieldnames to use the first row as keys, matching this page's header: true:
import csv
import io
import json
text = """name,age,city
Ada,30,London
Bob,25,Paris"""
rows = list(csv.DictReader(io.StringIO(text)))
print(json.dumps(rows, indent=2))
# [
# {"name": "Ada", "age": "30", "city": "London"},
# {"name": "Bob", "age": "25", "city": "Paris"}
# ]Every cell stays a string: age is "30", not 30. This page sets Papa dynamicTyping: true, so unquoted 30 becomes a JSON number and quoted "30" stays a string. The default delimiter is a comma; pass delimiter=';' for European CSVs or a literal tab for TSV files — this page auto-detects those. Completely empty lines are skipped, matching skipEmptyLines: true. A whitespace-only line is still a row. Missing fields use restval (default None → null). Extra fields go under restkey (default None), so json.dumps writes a "null" array key. Duplicate headers keep the last column (name,name plus Ada,Bob becomes {"name": "Bob"}); Papa renames extras to name_1. Open Excel exports with encoding='utf-8-sig' so a BOM does not glue itself to the first key. For the Papa Parse walkthrough, see CSV to JSON in the Browser with Papa Parse.
CSV to JSON in the shell
There is no POSIX CSV-to-JSON converter. csvkit csvjson (a Python wrapper around agate, Debian csvkit / python3-csvkit) reads a header row and writes a JSON array of objects — the same shape Convert writes. On the documented mapping (name,age,city with Ada,30,London and Bob,25,Paris), csvjson -i 2 pretty-prints with 2-space indent, matching this page. Default csvjson is compact (one line, a space after each colon). Integers serialize as 30.0 because agate stores them as floats; this page writes 30. csvjson is not POSIX. For the Papa Parse and csv.DictReader snippets, see Convert CSV to JSON in JavaScript and CSV to JSON in Python above.
csvkit csvjson (Linux / pip)
Confirmed here with csvkit 1.4.0 (csvjson 1.4.0). Use printf, not echo. -i / --indent is 2-space pretty-print. Type inference is on unless you pass -I / --no-inference:
# Pretty JSON (same 2-space indent as this page; ages are 30.0)
printf '%s' 'name,age,city
Ada,30,London
Bob,25,Paris' | csvjson -i 2
# [
# {
# "name": "Ada",
# "age": 30.0,
# "city": "London"
# },
# {
# "name": "Bob",
# "age": 25.0,
# "city": "Paris"
# }
# ]
# Compact JSON (this page always pretty-prints)
printf '%s' 'name,age,city
Ada,30,London
Bob,25,Paris' | csvjson
# [{"name": "Ada", "age": 30.0, "city": "London"}, {"name": "Bob", "age": 25.0, "city": "Paris"}]
# Keep every cell a string (like csv.DictReader above)
printf '%s' 'name,age,city
Ada,30,London
Bob,25,Paris' | csvjson -I -i 2
# "age": "30"Default inference also turns "", na, n/a, none, null, and . into JSON null. This page keeps those strings except a truly empty field, which is null in both. --blanks keeps the placeholder strings and writes an empty cell as "". yes / YES / Y become true; no / NO / N become false. This page only types true / false. on / off stay strings in both. +30 and +1e2 become 30.0 and 100.0 in csvjson; this page keeps those plus-prefixed cells as strings. A date-only cell such as 2026-09-18 stays a string in both. A value outside IEEE-754 exact integers such as 9007199254740993 becomes 9007199254740992.0 in csvjson; this page leaves that cell a string (Papa's FLOAT test stays inside ±2^53). A padded ID such as 007 becomes 7.0 here and 7 on this page; -I keeps "007". Completely empty lines and quoted empty rows become {"name":null,"age":null} objects in csvjson; this page skips them (skipEmptyLines: true). A comma-only row is a null object in both. Duplicate headers rename to name_2; Papa uses name_1. An extra field throws Row 0 has 3 values, but Table only has 2 columns.; this page keeps the row and stores extras under __parsed_extra. A missing field writes null for that key; this page omits the key. Empty stdin exits 1 with StopIteration; Convert stays disabled until there is text. A header-only file writes [] in both. -i 2 does not append a newline after the closing ]; this page's JSON.stringify does not either. --stream writes NDJSON (one object per line) and cannot be combined with -i. -k name keys the object by that column instead of writing an array. -H / --no-header-row invents a, b, c keys. Semicolon, tab, and pipe delimiters sniff the same way as this page when the default sniff limit can see them; -y 0 disables sniffing, so a semicolon file becomes one column unless you pass -d ';' or -t for tabs. GeoJSON flags (--lat / --lon) are not this converter. python3 -m csvkit.utilities.csvjson is the same CLI; python3 -m csvjson is not a module. miller mlr --icsv --ojson is a different converter: on this mapping it writes JSON integers without a trailing .0, and it is not csvkit. Homebrew brew install csvkit and pip pip install csvkit ship the same command. For the Papa Parse walkthrough, see CSV to JSON in the Browser with Papa Parse. The reverse direction is JSON to CSV converter.
Headers, delimiters and quotes
Header row becomes keys
The first line of the CSV is treated as the header row. Each column name becomes a key in the resulting JSON objects. For example, name,age,city produces objects with name, age, and city properties.
Delimiter detection
This tool auto-detects the delimiter by checking for commas, semicolons, tabs, and pipes. European CSVs often use semicolons (because commas are decimal separators). Tab-separated files (.tsv) also work. You do not need to specify the delimiter.
Quoted fields (RFC 4180)
If a value contains the delimiter character, a newline, or a double quote, it must be wrapped in double quotes. A double quote inside a quoted field is escaped by doubling it: "She said ""hello""" becomes She said "hello". This tool follows RFC 4180 quoting rules.
Technical details
- Paste CSV, load the sample, or choose a
.csvor.txtfile. Upload usesFileReader.readAsTextand fills the CSV box; it does not callPapa.parse(file). Nothing is sent to a server. - Convert runs
Papa.parseon that string withheader: true,skipEmptyLines: true, anddynamicTyping: true. The delimiter is left blank so Papa auto-detects from comma, tab, pipe, semicolon, or the ASCII record/unit separators (RFC 4180-style quoting). - Completely empty lines are skipped; whitespace-only rows are not (that needs
skipEmptyLines: 'greedy'). Papa'stestEmptyLinefor the boolean iss.length === 1 && s[0].length === 0— a single empty field. A blank line betweenname,age/Ada,30andBob,40is dropped, so Convert writes[{"name":"Ada","age":30},{"name":"Bob","age":40}]. A quoted empty row""is also skipped. A spaces-only row is one non-empty field; it drops the average field count below1.99(UndetectableDelimiterplusTooFewFields) and this page writes no JSON. A comma-only row,is two empty fields ({"name":null,"age":null}) and Convert succeeds. This page does not enable greedy skip. Numbers that look like decimal literals strictly inside±2^53and the stringstrue/falseare typed; other cells stay strings. A padded ID such as007matches that FLOAT test, soparseFloatturns it into7and the row becomes{"zip":7}. Quoted CSV"007"is still7.00123becomes123.00becomes0.007astays"007a". A date-only cell such as2026-09-18stays a string. This page does not turn offdynamicTyping. - That same FLOAT test accepts an optional minus, not a leading plus, so
n,+30becomes{"n":"+30"}. RFC 4180 quotes around"+30"are stripped first, so a quoted+30is still the string"+30".-30becomes the number-30.30becomes30.+30.5and+007stay strings. Plus is legal in an exponent, so1e+2becomes100;+1e2stays"+1e2". JSON has no plus-prefixed number (RFC 8259 §6). - That same FLOAT regex requires one or more digits after
eorE([eE][-+]?\d+), son,1ebecomes{"n":"1e"}. RFC 4180 quotes around"1e"are stripped first, so a quoted1eis still the string"1e".1e+stays"1e+".1e-stays"1e-".1Estays"1E".-1estays"-1e".1e+2becomes the number100.1e2and1E2are also100.1e-2becomes0.01.1e+0becomes1..5estays".5e";1.estays"1.e"(.5e2and1.e2are complete and become50and100).1e+2.5stays"1e+2.5".e2stays"e2". Surrounding spaces are kept, so1estays" 1e "— the regex never matches, soparseFloatis not called.parseFloatof"1e"or"1e+"would be1(they stop at the incomplete exponent); Papa never takes that path.JSON.parseof"1e"or"1e+"throws (RFC 8259 §6 exp needs one or moreDIGIT).JSON.parseof"1e+2"is100. Write1e+2or100for the number. In a semicolon table,n;xplus1e;foois{"n":"1e","x":"foo"}. A CRLF1eis the same . This page does not coerce an incomplete exponent. - That same FLOAT regex has no
0xor0Xhex prefix, son,0x1becomes{"n":"0x1"}. RFC 4180 quotes around"0x1"are stripped first, so a quoted0x1is still the string"0x1".0XFFstays"0XFF".0xffstays"0xff".-0x1stays"-0x1".+0x1stays"+0x1".0xstays"0x".0x10stays"0x10"(not16).0b10stays"0b10".0o10stays"0o10". Surrounding spaces are kept, so0x1stays" 0x1 "— the regex never matches, soparseFloatis not called.parseFloatof"0x1"would be0(it stops at thex); Papa never takes that path.NumberandparseIntof"0x1"are1.JSON.parseof"0x1"throws (RFC 8259 §6 has no hex prefix). YAML 1.2.2 Core0x [0-9a-fA-F]+would turn0x1into1; this page does not. Write1for the number (or16for0x10). In a semicolon table,n;xplus0x1;foois{"n":"0x1","x":"foo"}. A CRLF0x1is the same. This page does not coerce a hex prefix. - That same FLOAT regex matches a complete exponent such as
1e16(eplus one or more digits). After the match,testFloatcallsparseFloatand keeps a Number only whenfloatValue > MIN_FLOAT && floatValue < MAX_FLOAT, whereMAX_FLOATis2^53.parseFloatof"1e16"is10000000000000000, which is not< MAX_FLOAT, son,1e16becomes{"n":"1e16"}. RFC 4180 quotes around"1e16"are stripped first, so a quoted1e16is still the string"1e16".1e+16stays"1e+16".1E16stays"1E16".-1e16stays"-1e16".1.0e16stays"1.0e16".10e15stays"10e15"(parseFloatis also1e16).1e15becomes the number1000000000000000.9e15becomes9000000000000000.1e+2still becomes100. If the exclusive-range check fails, the original cell is kept, so1e16stays" 1e16 "— the regex matched andparseFloatran, but1e16is not< MAX_FLOAT.+1e16stays"+1e16"because of the leading plus, not this range check.JSON.parseof"1e16"is the number10000000000000000(RFC 8259 §6 allows exp). Write1e15for the number1000000000000000, or9007199254740991for the largest typed integer. In a semicolon table,n;xplus1e16;foois{"n":"1e16","x":"foo"}. A CRLF1e16is the same. This is not the incomplete-exponent1ecase and not the underflow1e-324case. This page does not parse integers as BigInt. - That same FLOAT regex also matches a complete tiny exponent such as
1e-324(e, a minus, and one or more digits). After the match,testFloatcallsparseFloatand keeps a Number only whenfloatValue > MIN_FLOAT && floatValue < MAX_FLOAT.parseFloatof"1e-324"is0(IEEE-754 underflow;Number.MIN_VALUEis5e-324).0is strictly inside±2^53, son,1e-324becomes{"n":0}. RFC 4180 quotes around"1e-324"are stripped first, so a quoted1e-324is still0.1e-325is also0.2e-324is0(rounds toward zero).5e-324becomes5e-324.4e-324becomes5e-324.1e-323becomes1e-323.1e-308becomes1e-308.1E-324and1.0e-324are also0.10e-325is0.-1e-324is JavaScript-0;JSON.stringifywrites0.1e-324becomes0— the regex matched andparseFloatran, and0is inside the range.+1e-324stays"+1e-324"because of the leading plus, not this underflow.JSON.parseof"1e-324"is also0(RFC 8259 §6 allows exp). Write5e-324forNumber.MIN_VALUE. In a semicolon table,n;xplus1e-324;foois{"n":0,"x":"foo"}. A CRLF1e-324is the same. This is not the complete-exponent1e16case (that original string is kept) and not the incomplete-exponent1ecase. This page does not keep underflow as a string. - That same FLOAT test also accepts a leading decimal such as
.5or a trailing decimal such as1., son,.5becomes{"n":0.5}andn,1.becomes{"n":1}. RFC 4180 quotes around".5"are stripped first, so a quoted.5is still0.5. A quoted1.is still1.-.5becomes the number-0.5.-1.becomes-1.0.5stays0.5.1.0becomes1. A lone.stays the string".".1.2.3stays"1.2.3"..5e2becomes50;1.e2becomes100.JSON.parserejects.5and1.(RFC 8259 §6 requires an integer part and at least one digit after a decimal point). - That same FLOAT regex has no underscore, so
n,1_000becomes{"n":"1_000"}. RFC 4180 quotes around"1_000"are stripped first, so a quoted1_000is still the string"1_000".1000becomes the number1000.1_000.5stays"1_000.5".-1_000stays"-1_000".+1_000stays"+1_000".1_000_000stays"1_000_000".1_000e2stays"1_000e2". Surrounding spaces are kept, so1_000stays" 1_000 "— the regex never matches, soparseFloatis not called.parseFloatof"1_000"would be1(it stops at the underscore); Papa never takes that path.JSON.parseof"1_000"throws (RFC 8259 §6 has no digit separator). Write1000for the number. In a semicolon table,n;xplus1_000;foois{"n":"1_000","x":"foo"}. Unquoted1,000in a comma table isTooManyFields. This page does not strip underscores. - After that FLOAT regex matches, Papa's
testFloatcallsparseFloatand keeps a Number only whenfloatValue > MIN_FLOAT && floatValue < MAX_FLOAT, whereMAX_FLOATis2^53(9007199254740992). Those bounds are exclusive, so9007199254740991becomes the number9007199254740991andn,9007199254740992becomes{"n":"9007199254740992"}. RFC 4180 quotes around"9007199254740992"are stripped first, so a quoted9007199254740992is still the string"9007199254740992".-9007199254740991becomes the number-9007199254740991.-9007199254740992stays"-9007199254740992".9007199254740993stays"9007199254740993"becauseparseFloatof that digit string is9007199254740992, which is not< MAX_FLOAT.JSON.parseof"9007199254740992"is the number9007199254740992(exactly representable);JSON.parseof"9007199254740993"is9007199254740992(IEEE-754). This page does not parse integers as BigInt. - That same FLOAT regex allows surrounding whitespace (
/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/), son, 30becomes{"n":30}.parseFloat(" 30 ")is 30. RFC 4180 quotes around" 30 "are stripped first, so a quoted30is still30. A leading-only space and a trailing-only space are also30.-30becomes-30..5becomes0.5.1.becomes1.1e+2becomes100. An internal space such as3 0stays"3 0". A space-only cell stays" ". Papa's boolean test is exact equality, sotruestays" true ". Papa'sISO_DATEtest is a full-string match, so2026-09-18T12:00:00Zstays a string. If the exclusive-range check fails, the original cell is kept, so9007199254740992stays" 9007199254740992 ".9007199254740991becomes9007199254740991.JSON.parseof" 30 "is also30(RFC 8259 insignificant whitespace). This page does not trim cells beforedynamicTyping. - That same FLOAT
\sincludes tab, but an unquoted both-side tab around30on a one-column header is first a delimiter. Papa leaves the delimiter blank, soguessDelimitertries comma, tab, pipe, semicolon, and the ASCII record/unit separators, and keeps a candidate only when the average field count is greater than1.99. Headernplus an unquoted tab,30, and a tab is three fields, so tab wins and the row isTooManyFields(expected 1 fields but parsed 3). This page shows that message and writes no JSON. RFC 4180 quotes keep those tabs inside one cell, so tab is not guessed.parseFloat("\\t30\\t")is 30, so a two-column comma tablen,xplus a quoted tab-padded30andfoobecomes{"n":30,"x":"foo"}. The same two-column table with an unquoted tab-padded30is also30because comma already won. A leading-only tab or a trailing-only tab on a one-column header averages 1.5 fields, so tab is not chosen; Papa still types 30, butUndetectableDelimiterdefaults to comma and this page still writes no JSON. A quoted tab-paddedtruestays a string (boolean is exact equality). A quoted tab-padded ISO timestamp stays a string (ISO_DATEis a full-string match). If the exclusive-range check fails, the original cell is kept, so a quoted tab-padded9007199254740992stays that tab-padded string.JSON.parseof a tab-padded30is also 30 (RFC 8259 insignificant whitespace). This page does not expose a delimiter picker. - A clean one-column table is a different delimiter warning. Header
namethenAdaaverages 1 field, soguessDelimiterkeeps no candidate (threshold1.99). Papa still defaults to comma andresult.datais[{"name":"Ada"}], but Convert treats anyresult.errorsas fatal (errors.length > 0), soUndetectableDelimiter(Unable to auto-detect delimiting character; defaulted to ',') is shown and this page writes no JSON.zipthen007is the same warning; Papa would type[{"zip":7}]but the page still writes no JSON. Quoted"name"/"Ada"is the same. Two-columnn,xplus30,fooaverages 2 fields, comma wins, there is no warning, and Convert writes[{"n":30,"x":"foo"}]. Adding a dummy second column (name,xthenAda,) becomes[{"name":"Ada","x":null}]because the empty cell is null, and Convert succeeds. This is notTooManyFields. This page does not ignore delimiter warnings and has no delimiter picker. - A two-column semicolon table is the success path for that same
guessDelimiterlist.name;ageplusAda;30averages 2 fields, so semicolon wins. There is noUndetectableDelimiter, and Convert writes[{"name":"Ada","age":30}].name|ageplusAda|30is the same with pipe. Papa's FLOAT regex is/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/— a decimal point, not a comma — son;xplus3,14;foobecomes{"n":"3,14","x":"foo"}. RFC 4180 quotes around"3,14"are stripped first, so a quoted3,14is still the string"3,14". Write3.14for a JSON number:n;xplus3.14;foobecomes{"n":3.14,"x":"foo"}. A quoted"3.14"is still3.14. A comma inside a quoted field in a semicolon table stays in the field (Ada;"hel,lo"is{"name":"Ada","note":"hel,lo"}). Mixed delimiters fail:name,ageplusAda;30isUndetectableDelimiterplusTooFewFields({"name":"Ada;30"});name;ageplusAda,30isUndetectableDelimiterplusTooManyFields. Convert treats those errors as fatal and writes no JSON. Unquoted3,14in a comma table is alsoTooManyFields(3and14are two fields). A one-columnnotethenhello;worldkeeps the semicolon inside one cell and is stillUndetectableDelimiter. A space after the semicolon (Ada; 30) becomes the number30because FLOAT allows surrounding whitespace.zip;xplus007;foois still{"zip":7,"x":"foo"}. An empty cell after a semicolon (Ada;) isnull. This is not the tab-padded one-columnTooManyFieldsand not the one-columnname/AdaUndetectableDelimiter. This page does not expose a delimiter picker or a decimal-comma locale toggle. - Duplicate headers are renamed so later columns do not overwrite earlier ones. The first
namestaysname; a laternamebecomesname_1, thenname_2.name,nameplusAda,Bobbecomes{"name":"Ada","name_1":"Bob"}. RFC 4180 quotes around"name"are stripped first, so a quoted"name","name"is the same. A thirdnamebecomesname_2({"name":"Ada","name_1":"Bob","name_2":"Cam"}). Ifname_1already exists as a real header (name,name_1,name), the laternamebecomesname_2.nameandNameare different keys (case-sensitive). A leading space (name, name) is a different key. Two empty headers become""and_1.meta.renamedHeadersis{ name_1: "name" }, but this page does not expose that map ortransformHeader.JSON.parseof{"name":"Ada","name":"Bob"}keeps the last value (RFC 8259 §4); Papa avoids that overwrite. There is noFieldMismatch; Convert writes the JSON. - After each data row is built, Papa compares the parsed field count with the header count.
name,age,cityplusAda,30isTooFewFields(Too few fields: expected 3 fields but parsed 2). Papa still builds{"name":"Ada","age":30}and omitscity(the missing key is notnull). Convert treats anyresult.errorsas fatal (errors.length > 0), so thatFieldMismatchis shown and this page writes no JSON. A one-cell rowAdaisTooFewFieldsexpected 3 parsed 1 ({"name":"Ada"}). RFC 4180 quotes around"Ada"do not change the count. A trailing comma (Ada,30,) is three fields: the emptycitybecomes JSONnulland Convert writes{"name":"Ada","age":30,"city":null}. An empty middle cell (Ada,,NY) is also three fields ({"name":"Ada","age":null,"city":"NY"}). A long row such asname,ageplusAda,30,extraisTooManyFields(Too many fields: expected 2 fields but parsed 3); Papa stores the extra cell on__parsed_extraas["extra"]. Two extras become["extra","more"]. A quoted extra is the same. This is not the tab-padded one-columnTooManyFields(that is delimiter detect). This page does not ignoreFieldMismatchand has no partial-output mode. - A field that starts with a quote must find a closing quote before EOF (RFC 4180).
name,noteplusAda,"helloisMissingQuotes(Quoted field unterminated). Papa still builds{"name":"Ada","note":"hello"}(the opening quote is skipped; the rest of the input stays innote). Convert treats anyresult.errorsas fatal (errors.length > 0), so thatQuoteserror is shown and this page writes no JSON. A closedAda,"hello"is the same object and Convert writes the JSON. A comma inside the unclosed quote (Ada,"hello,world) stays innote({"name":"Ada","note":"hello,world"}). A closed multiline quote (Ada,"hellothen a newline thenworld") is valid RFC 4180 and Convert writes{"name":"Ada","note":"hello\nworld"}. An unclosed quote that continues onto the next line (Ada,"hellothenBob,ok) swallows that line intonote({"name":"Ada","note":"hello\nBob,ok"}) and is stillMissingQuotes. This is notFieldMismatch(that isTooFewFields/TooManyFields). This page does not ignoreQuoteserrors and has no partial-output mode. - After a closing quote, Papa accepts a delimiter, a newline, or spaces then a delimiter or newline (
extraSpaces). A trailing space at EOF afterAda,"hello"is not those.name,noteplusAda,"hello"and a trailing space isInvalidQuotes(Trailing quote on quoted field is malformed) plusMissingQuotes(Quoted field unterminated). Papa still builds{"name":"Ada","note":"hello\" "}(the closing quote and the space stay innote). Convert treats anyresult.errorsas fatal (errors.length > 0), so thoseQuoteserrors are shown and this page writes no JSON. A closedAda,"hello"is{"name":"Ada","note":"hello"}and Convert writes the JSON. A space inside the quotes (Ada,"hello ") is valid RFC 4180 and Convert writes{"name":"Ada","note":"hello "}. A space after the close then a newline isextraSpacesand Convert writes{"name":"Ada","note":"hello"}. A space after the close then a comma ("Ada" ,hello) is alsoextraSpacesand Convert writes{"name":"Ada","note":"hello"}. A space before the opening quote (Ada, "hello") is not a quoted field (the quote is not adjacent to the delimiter) and Convert writes{"name":"Ada","note":" \"hello\""}. A tab after the close is alsoInvalidQuotes({"name":"Ada","note":"hello\"\ "}). A quoted30then a trailing space stays the string"30\" "(not the number30). A quoted empty cell plus a trailing space (Ada,""plus a space) is the same pair ofQuoteserrors; Papa still builds{"name":"Ada","note":"\" "}(notnull). This is not the unclosedMissingQuotes-only case (Ada,"hellowith no close). This page does not ignoreQuoteserrors and has no quote-repair mode. - RFC 4180 §7 says a double-quote inside a quoted field must be escaped by another double quote (ABNF
2DQUOTE).name,noteplusAda,"hel""lo"is that pair: the""inside the quotes is one quote, so Convert writes{"name":"Ada","note":"hel\"lo"}and there is noQuoteserror.JSON.stringifywrites the quote as\"(RFC 8259). The RFC example"aaa","b""bb","ccc"becomes{"a":"aaa","b":"b\"bb","c":"ccc"}. A quote at the start (Ada,"""hello") is{"name":"Ada","note":"\"hello"}. A quote at the end (Ada,"hello""") is{"name":"Ada","note":"hello\""}. A field that is only a quote (Ada,"""") is{"name":"Ada","note":"\""}(notnull; a quoted emptyAda,""is stillnull). A comma inside the escaped field (Ada,"hel"",lo") stays innote({"name":"Ada","note":"hel\",lo"}). A doubled quote in a header (name,"no""te"plusAda,hello) becomes the keyno"te. A single inner quote without doubling (Ada,"hel"lo") isInvalidQuotes(Trailing quote on quoted field is malformed); Papa still builds{"name":"Ada","note":"hel\"lo"}, but this page treats thatQuoteserror as fatal and writes no JSON. A backslash is not RFC 4180 (Ada,"hel\"lo") and is alsoInvalidQuotes. An unquoted inner quote (Ada,hel"lo) is accepted by Papa as{"name":"Ada","note":"hel\"lo"}and Convert writes that JSON (RFC 4180 §5 would forbid a quote in an unquoted field). An unquoted doubled pair (Ada,hel""lo) keeps both quotes ({"name":"Ada","note":"hel\"\"lo"}). An odd triple mid-field (Ada,"hel"""lo") isInvalidQuotes. A doubled quote inside a number-looking cell (Ada,"3""0") stays the string"3\"0"(not the number30). This is not the trailing-spaceInvalidQuotescase (Ada,"hello"plus a space) and not the unclosedMissingQuotes-only case (Ada,"hellowith no close). This page does not ignoreQuoteserrors and has no quote-repair mode. - Papa's boolean test is exact equality:
value === 'true'orvalue === 'TRUE'becomes JSONtrue;value === 'false'orvalue === 'FALSE'becomes JSONfalse. Title-caseTrueandFalseare not those four strings, soflag,Truebecomes{"flag":"True"}andFalsestays"False". RFC 4180 quotes around"true"are stripped first, so a quotedtrueis still the booleantrue; a quotedTruestays"True".yesandYesstay strings. JSON has only lowercasetrueandfalse(RFC 8259 §3). - After those FLOAT and
true/falsetests, Papa'sISO_DATEtest matches a full-string ISO-8601 timestamp (YYYY-MM-DD,T, hours and minutes, optional seconds and a fraction, thenZor a±HH:MMoffset) and turns it intonew Date(value). Convert then pretty-printsresult.datawithJSON.stringify.Date.prototype.toJSON(ECMA-262) callstoISOString, which writes UTC with milliseconds, so2026-09-18T12:00:00Zbecomes{"when":"2026-09-18T12:00:00.000Z"}. Quoted CSV"2026-09-18T12:00:00Z"is still a Date. A space instead ofT, or a T-time without an offset, stays a string. An offset such as2026-09-18T12:00:00-05:00stringifies as2026-09-18T17:00:00.000Z. JSON has no Date type (RFC 8259). - After those FLOAT,
true/false, andISO_DATEtests, Papa'sparseDynamicreturnsvalue === '' ? null : value. An empty cell is that empty string, soname,noteplusAda,becomes{"name":"Ada","note":null}. RFC 4180 quotes around""are stripped first, so a quoted empty cell is stillnull. A space-only cell stays the string" ". The wordnullstays the string"null".N/Astays"N/A".skipEmptyLinesdrops a completely empty line, not an empty cell inside a kept row. A blank line betweenAda,30andBob,40is skipped; a spaces-only row is not.JSON.stringifywrites thenulltoken (RFC 8259 §3) and keeps the key. - Papa leaves
commentsat the defaultfalse. RFC 4180 has no comment syntax, so a line that starts with#is a data row.name,ageplus# note,ignoredplusAda,30has no error, and Convert writes[{"name":"# note","age":"ignored"},{"name":"Ada","age":30}]. A CRLF hash line is the same.#Ada,30plusBob,40is[{"name":"#Ada","age":30},{"name":"Bob","age":40}]. A one-field# commentrow (no comma) isUndetectableDelimiterplusTooFewFields; Papa still builds{"name":"# comment"}, but this page writes no JSON. A quoted"# comment"is a field value ({"name":"Ada","note":"# comment"}). A space before the hash is still a data row.// note,30is also kept.comments: true(orcomments: '#') would skip a line whose first characters are#; this page does not set that option. A hash in the header (#name,ageplusAda,30) becomes the key#name. This is notskipEmptyLines(a blank line is dropped; a#line is not). - If Papa reports any errors (for example TooFewFields / TooManyFields / MissingQuotes / InvalidQuotes), the page shows those messages and does not write JSON — even when some rows parsed. On success it pretty-prints
result.datawith 2-spaceJSON.stringify. Createsconverted.json. Download Click JSON to run the conversion. Download saves that string asapplication/json(converted.json). This page does not convert JSON back to CSV or read Excel workbooks.
FAQ
- Does this tool upload my CSV?
- No. All parsing runs in your browser using Papa Parse. Your data is never sent to a server.
- What file name does Download create?
- Download creates converted.json containing the parsed array with 2-space indentation.
- How are duplicate column headers handled?
- Papa Parse renames duplicates by appending _1, _2, etc. For example, two "name" columns become "name" and "name_1".
- Does it auto-detect delimiters?
- Yes. Papa Parse detects commas, semicolons, tabs, and other common delimiters based on field count consistency.
- Are numbers converted or kept as strings?
- With dynamicTyping enabled, Papa Parse converts values that look like numbers (e.g., 30, 3.14), quoted or not, to JavaScript numbers. CSV quotes only escape delimiters, quotes and newlines; they do not keep a value as a string.
Related
- JSON to CSV converter — convert JSON arrays back to CSV files
- CSV to JSON in the Browser with Papa Parse
- Convert JSON to CSV in JavaScript: Papa.unparse vs Papa.parse
- Sibling tools: JSON formatter, YAML to JSON, and URL encoder