This converter is written entirely in JavaScript and runs completely in the browser. Once the page finishes loading, there are no subsequent calls to the server. Because of this, there's no risk of data breach. Other converters written in server-side languages, which usually submit input and output text using plain HTTP instead of HTTPS, transmitting your data in the clear as plain, unencrypted text, expose you and your data to unnecessary risk. While these server-side converters are good exercises in programming, and may be useful in a trusted intranet setting, they should not be used if they are hosted by untrusted third parties on the unsecured Web.
Conversion of the CSV input text to JavaScript objects is handled by code written by me. Conversion of the JavaScript objects to JSON output text is handled by Douglas Crockford's public domain JSON JavaScript library.
Coming Soon!™
- RFC 4180 compliance
- AMD support
- Grunt
- JSHint
- EditorConfig
- Travis CI
- Bower
- External file parser (Browser: Ajax, WebSocket; Node.js: fs, request, etc.)
- And more! (Request a Feature)

This is awesome! Thank you. I was about to copy and paste some records from a table and format as JSON manually so that I could protype web forms in Ext Designer and the thought of having to do it manually was not pleasant. Sure enough, your page was only a quick Google away
Excellent work!
Yeah, this rules. Thank you!
Thank you for providing this tool!
Very useful. Works also with big datasets. Thank a lot.
Any chance for the code to this be released? Be nice to self host, or port to run via command line rather than web form (e.g. Rhino JS engine or MS JScript for WSH).
Thanks for the suggestion, David. You’re not the first person to request something like this. I’m in the process of setting up a GitHub repository for this utility.
If you have any other suggestions, please feel free to let me know!
Code would be good for me to, but totally understand if your looking to corner the market in CSV to JSON conversion
Not at all! I’m an avid support of free/libre/open source software. Besides, the converter makes use of the JSON library written by Douglas Crockford; I feel it would only be fair to “pay it forward” and release the code.
I should have a GitHub repository set up soon.
Thank you so much for this tool. It is extremely helpful and has saved me a LOT of time!
Great stuff, very helpful aid to the development process.
You are the man. Thank you.
Outstanding!
Thanks for this, saved me in a pinch!
wow! This is terrific!
Just FYI, it looks like there’s a problem with either your example or the converter if you have a quoted segment with a comma and newline in it.
Eg:
foo, bar, baz
12, 34, “5,
6″
78, 90, 12
leaves the json area empty when you hit “convert”.
(I’ve written a couple of csv parsers in my time so I have an idea of the pitfalls
RFC 4180 would cover this case. I’ve added an issue to this project’s GitHub issue tracker for RFC 4180 Compliance. Thanks for your feedback!
Hey it’s awesome stuff, I always prefer this to convert CSV to JSON.. great work..keep it up..
thank you. It´s useful.
Excellent utility, THANKS!!
Thank you for creating this tool! It was a great time saver.
Hello Chris,
Excuse my utter ignorance but what is a ‘Header Row’?
I’m trying to create a JSON file to import a website blacklist into Untangle web filter.
I’d appreciate your help.
regards,
Tim
In this case, a header row is a row consisting of column labels. Each column label is used as the property name for its corresponding property in each of the JSON objects that gets created from each of the data rows.
For example, here’s what the CSV might look like to represent some user data:
The JSON representation of this CSV:
[ { "userId": "0", "username": "scooper", "firstName": "Sheldon", "lastName": "Cooper" }, { "userId": "1", "username": "rkoothrappali", "firstName": "Rajesh", "lastName": "Koothrappali" }, { "userId": "2", "username": "hwolowitz", "firstName": "Howard", "lastName": "Wolowitz" }, { "userId": "3", "username": "lhofstadter", "firstName": "Leonard", "lastName": "Hofstadter" } ]This saved me a LOT of time. Very helpful. THANKS! I’ll be looking forward to the git repo update.
is it possible to get me t javascript code for tis converter ??? it wud be vry helpful !!
Sure! Just visit the GitHub project page and you’re good to go.
This is great. Thanks. Saves hours.
Thanks. It was a greta a tool.
This is incredible!!!! Thank you!!!
Sorry, doesn’t work properly.
Converts:
Fahrzeugname;Modelltyp;Aufbauform;Preis;Platz;Familie;Krafstoffart;Getriebe;PS;
C 180 CDI BlueEFFICIENCY T-Modell;C-Klasse;T-Modell;34837,25;4;1;Diesel;Manuell;120;
C 200 CDI BlueEFFICIENCY T-Modell;C-Klasse;T-Modell;36622,25;4;1;Diesel;Manuell;136;
to:
[
{
"Fahrzeugname;Modelltyp;Aufbauform;Preis;Platz;Familie;Krafstoffart;Getriebe;PS;": "C 180 CDI BlueEFFICIENCY T-Modell;C-Klasse;T-Modell;34837",
"undefined": "25;4;1;Diesel;Manuell;120;"
},
{
"Fahrzeugname;Modelltyp;Aufbauform;Preis;Platz;Familie;Krafstoffart;Getriebe;PS;": "C 200 CDI BlueEFFICIENCY T-Modell;C-Klasse;T-Modell;36622",
"undefined": "25;4;1;Diesel;Manuell;136;"
}
]
It’s not working because your input doesn’t consist of comma-separated values (CSV). Instead, the values are separated by semicolons.
Hi Chris,
How difficult is it to add the ; as a delimiter as well?
Thanks
Ahmed
Not difficult, but then it wouldn’t be a CSV converter.
I’d be willing to add support for other delimiters if other people find it to be important. Feel free to submit a feature request here: http://github.com/cparker15/csv-to-json/issue
I do not know what a Header Row is, ad hoc. I pasted comma-delimited E-mail addresses wanting them to be listed in rows and your programs fed back: The CSV text MUST have a header row! I’m confused.
So, you pasted something like this…
user1@example.com,user2@example.com,user3@example.com
What would you ideally see as JSON output?
Thanks fir getting back.
Yes. I want to enter user1@example.com,user2@example.com,user3@example.com, etc. and have a result of:
user1@example.com
user2@example.com
user3@example.com
Perfect….works perfectly first time…nice utility!
VERY VERY EXTREME COOL !!!
10x
I have a 300mb csv file with 3 million records; will the converter work id I paste that into the window? I know chrome would crash but explorer doesn’t. I have 8 gigs of ram and failing at all attempts at writing something in python to do this for me.
Honestly, I wouldn’t expect this to work as-is. The converter would likely have to be modified to run the conversion from CSV in batches.
Please feel free to add a new feature request here to get this on my backlog: http://github.com/cparker15/csv-to-json/issue
This is really great, great work. Thank you very much. A big hug from Brazil.
When you are next in Rome email me for a free beer or two!
(can’t fork you on github cos i just don’t get it!)
beautiful!
thanks! Kd
Hi Parker, this is great and really works for me! Quite appreciated for providing this conversion tool.
Hi Chris, someone just turned me onto this, and i am so extremely grateful for your sharing this tool with the world! Now, i am pretty new to programming, and I need to do a visualization with 90,0000 historical records. They are in csv. Please excuse me if this question is totally simplistic to you, but is it enough to copy my file from xcel and paste the data into the box? I have been trying to do a drag and drop and that doesn’t work…however my copy and paste isn’t giving me the correct spelling of my header rows — appreciated.
BTW that 90,000
not 900,000
I would try a copy/paste from Notepad, Notepad++, or some other plain text editor. I’ve not tried copying and pasting directly from Excel.
I never thought of enabling drag/drop of a CSV file. I like the idea. If you think this would be helpful, please feel free to submit a feature request: http://github.com/cparker15/csv-to-json/issues
Much obliged.
You just saved me so much time I might be able to take a vacation.
Thanks, maybe you could make a choice of the selector supporting “,”, “:”, “;”,(usual suspects).
awesome!
This is absolutely perfect! Does what it says on the tin!! Saved me a TON of time!
Thanks! It saved a lot and i didnt look for any other website. Thanks again for keeping it free.
Thanks for sharing … excellent tool! and thanks for posting it to github so I can read the code (I’m learning json now) and learn more.
What about the var that holds your Array? This is shit JSON
If your goal is to take the output of this converter and embed it in a JavaScript source file, then it’s up to you to take the JSON output and create your own
vardefinition for it.Remember, even though JSON looks like JavaScript, it’s not; it’s JSON.
It’s true that the internet will do anything you want it to. Thanks man.
Dear Sir,
What if I wanted to have json in {“source”:1,”target”:0,”value”:1}, format, I have a table and I want to show the network graph in D3.js
Thanks in advance
The idea behind this converter is to convert a CSV-structured table to an array of objects and encode the resulting data structure in JSON.
So, your CSV looking like this:
Would result in JSON that looks like this:
Is that about what you wanted?
Excellent tool!
This is just great, saved roller coaster of writing our own parser. Thanks a million
This tools saved my bacon on a recent project excellent work.
Thanks very much! Saved me loads of time and works like a charm.
is it possible to use a column as a key so that a change in value in that column forces a new array of values?
eg.
first-name,last-name,Company,City,State
Bill,Smith,ABC,Greenwich,CT
John,Charles,ESPN,New York,NY
Katie,Jones,ESPN,New York,NY
Tom,Gross,NBC,Boston,MA
keyed on Company converts to:
{
“ABC” : [
{
"first-name": "Bill",
"last-name": "Smith",
"City": "Greenwich",
"State": "CT"
}
],
“ESPN” : [
{
"first-name": "John",
"last-name": "Charles",
"City": "New York",
"State": "NY"
},
{
"first-name": "Katie",
"last-name": "Jones",
"City": "New York",
"State": "NY"
}
],
“NBC” : [
{
"first-name": "Tom",
"last-name": "Gross",
"City": "Boston",
"State": "MA"
}
]
}
Not currently supported, but would be straightforward to implement. Please feel free to open a new feature request via GitHub. I’m actually going to have some time soon to revisit this.
I used a small sample file to create a JSON file with which to test a CouchDB install. When I try to save the document though I get an error bad_Request, document must be a json object. Can anyone tell me why this is happening?
[
{
"STORE": "1",
"LONGITUDE": "-80.7806678",
"LATITUDE": "35.3710995"
},
{
"STORE": "2",
"LONGITUDE": "-80.77777656",
"LATITUDE": "35.32015444"
},
{
"STORE": "3",
"LONGITUDE": "-80.76300224",
"LATITUDE": "35.3389554"
},
{
"STORE": "4",
"LONGITUDE": "-80.73599692",
"LATITUDE": "35.29502129"
},
{
"STORE": "5",
"LONGITUDE": "-80.78213442",
"LATITUDE": "35.380121"
}
]
According to JSONLint, that’s valid JSON.
Does CouchDB support arrays, or does it expect an array to be wrapped in an object?