Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. CSV & Data Analysis
  3. CSV to JSON Converter
Add to favorites

CSV to JSON Converter

Convert CSV to JSON or JSON back to CSV, keeping zip codes, IDs and quoted text exactly as written and listing anything the conversion changes.

Rows never leave your deviceMore csv & data analysisJump to full guide
Related readingWhy Parsing CSV Is Harder Than It Looks (RFC 4180)11 minCSV Data Processing: Tips for Handling Large Datasets10 min

Initializing in your browser…

You might also like

CSV to Excel Converter

Convert a CSV to an Excel .xlsx or OpenDocument .ods workbook with real number, currency, percentage and date cells, while keeping zip codes and IDs exactly as written.

CSV Data Transformer

Clean up CSV columns with a chain of 34 steps: trim, change case, extract digits, reformat dates and numbers, mask values and more, with a live before and after preview.

Mock Data Generator

Generate realistic test data as JSON, CSV or SQL: valid card numbers and IBANs, safe example e-mails, and a seed that brings the same rows back.

A sample run

A customer export holds zip codes with leading zeros, an empty phone number, a note with quotes inside it, and a yes/no column. It needs to become JSON for an API that expects numbers and booleans where they make sense.

CSV

id,name,zip,phone,note,active
1,Alice Johnson,07030,+1 201 555 0143,"Prefers ""morning"" calls",true
2,Bob Smith,00501,,"Widget, large",false
What CSV to JSON Converter produces

JSON (array of objects, default settings)

[
  {
    "id": 1,
    "name": "Alice Johnson",
    "zip": "07030",
    "phone": "+1 201 555 0143",
    "note": "Prefers \"morning\" calls",
    "active": true
  },
  {
    "id": 2,
    "name": "Bob Smith",
    "zip": "00501",
    "phone": "",
    "note": "Widget, large",
    "active": false
  }
]

The ids become numbers because 1 and 2 read back exactly, and true/false become booleans. The zip codes stay strings, since the number 7030 would lose the leading zero. The doubled quotes in the note are the CSV way of writing a quote, so the JSON holds the words with real quote marks, and the comma inside "Widget, large" stays part of the value. The empty phone number is an empty string rather than null, and no notes appear because nothing was changed in a way that cannot be undone.

Convert CSV to JSON and Back Without Losing Data

Turn a CSV file into JSON for an API, a script or a config file, or turn a JSON array back into a CSV for a spreadsheet. Numbers and true/false values are typed only when that is safe, so 07030 stays "07030" and a 20-digit order number is not rounded, and every value the conversion cannot carry exactly is listed above the result.

How to use

  1. 1Drop a CSV or JSON file on the page, choose one, paste the text, or press Try a sample.
  2. 2Check the direction: a .json file or pasted JSON switches to JSON to CSV by itself, and the two buttons at the top swap it.
  3. 3Pick the output shape and how values are typed. The defaults suit most files.
  4. 4Open More options for null handling, trimming, a row index or nested objects.
  5. 5Read any notes above the result, then press Copy or Download.
  6. 6To check a round trip, press Use output as input and convert the result back.

Key features

  • Converts in both directions, detecting JSON input by file name or content
  • Numbers and booleans typed only when the text reads back unchanged, so leading zeros and long IDs survive
  • Five JSON shapes: array of objects, wrapped with a count, keyed by a column, one array per column, or arrays of values
  • Duplicate, empty and extra column names handled and reported, never dropped
  • Optional nested objects from headers like address.city, with conflicts kept flat and explained
  • JSON to CSV with every key from every object, nested objects flattened and lists kept as JSON text
  • Optional null mapping for empty cells and words such as NULL, N/A or None
  • Indent with 2 or 4 spaces, or minify
  • CSV output with CRLF line endings, minimal quoting and a UTF-8 byte order mark for Excel
  • Runs in your browser with large outputs previewed, while Copy and Download include everything

How it works

Typing that does not damage your data. Every field in a CSV file is text, while JSON has numbers, booleans and null. A careless converter turns the zip code 07030 into the number 7030, the product code 1e5 into 100000 and a long account number into a rounded approximation. By default this tool converts a value to a number or a boolean only when writing it back out gives exactly the same text, so 42 becomes 42 and true becomes true, while 007, 0.10 and 1e5 stay strings. If you want everything as text, choose Everything is a string. If the values are quantities and leading zeros do not matter, choose Numbers, even when they do not read back, and each value that changed is counted with an example.

Five output shapes. Array of objects, one object per row, is what most code expects. You can also wrap that array in an object with a count, index the rows by a column such as an ID, transpose the table into one array per column (handy for charting libraries), or write plain arrays of values with no column names at all. When rows are indexed by a column, a repeated or empty key is reported instead of silently replacing an earlier row.

Headers and odd rows. A JSON object cannot hold two members with the same name, so a duplicated header is renamed, for example to name (2), and the rename is shown. Rows with more fields than the header still convert, with the extras in numbered columns. Headers such as address.city can optionally become nested objects; a column that cannot be nested without losing a value, for instance when both address and address.city exist, stays flat and is explained.

JSON to CSV. Drop or paste a JSON array and the direction switches automatically. The CSV gets one column for every key found in any object, in the order keys first appear, so a field only some records have is still kept. Nested objects become columns like address.city, and lists are written into the cell as JSON text. The downloaded CSV uses CRLF line endings, quotes only fields that need it, and starts with a UTF-8 byte order mark so Excel shows accented names correctly.

Details that matter. Spaces inside fields are kept unless you turn on trimming, because RFC 4180 treats them as part of the value. Quotes inside a field arrive in the JSON intact. Empty cells stay empty strings unless you ask for null, and you can map words such as NULL or N/A to null under More options. The file is read and converted in your browser, so nothing is uploaded.

Where this fits a data pipeline

  • Seeding an app or an API

    Export a product list or user table from a spreadsheet and get an array of objects ready to POST, with prices as numbers and SKUs with leading zeros still intact.

  • Getting API data into Excel

    Paste a JSON response, switch to JSON to CSV, and download a file where nested fields become their own columns and nothing that appears in only some records is missed.

  • Building configuration or test data

    Keep test data in a spreadsheet that non-developers can edit, then convert to keyed JSON indexed by an ID column for a script to read.

  • Feeding a chart library

    Choose One array per column to get { "month": [...], "sales": [...] }, the layout many charting libraries take directly.

Tips & best practices

  • If the notes panel is empty, the conversion carried every value exactly and can be reversed.
  • For data that must survive unchanged, such as account numbers, choose Everything is a string.
  • Leave trimming off unless you know the spaces are padding. A value with spaces around it is, strictly speaking, a different value.
  • Use output as input is a quick way to check a round trip: convert, swap, and compare with your original.

Examples

  • Zip codes and phone numbers

    A customer list with 07030 and 00501 in the zip column converts with those values as strings. The id column, holding 1, 2, 3, becomes numbers, and true/false becomes JSON booleans.

  • Records with different fields

    Converting [{"a":1,"b":2},{"a":3,"c":4}] to CSV gives the columns a, b and c, with empty cells where a record has no value.

  • Loose typing on purpose

    With Numbers, even when they do not read back, the cells 007 and 1e3 become 7 and 1000, and the notes list both so you can see exactly what changed.

Frequently asked questions

Will 007 or 07030 become a number?

Not by default. A value becomes a number only if writing that number back produces the same text, and 7 is not 007. Choose Numbers, even when they do not read back if you want the conversion anyway; every changed value is then listed.

What happens to very long numbers like order IDs?

They stay strings. JSON numbers are usually read as 64-bit floating point, which holds about 15 to 17 significant digits, so a 20-digit ID would be rounded. Because the rounded number does not read back as the original text, the default setting keeps it as text.

Can I get null instead of empty strings?

Yes. Under More options, turn on Empty cells become null, or choose which words, such as NULL, N/A or None, should become null. Converting back to CSV writes null as an empty cell, so the notes count how many cells this affected.

My file has two columns with the same name. What happens?

The second one is renamed, for example to email (2), and the note above the result says so. A JSON object cannot have two keys with the same name, and renaming keeps both columns' values.

How are nested objects and arrays turned into CSV?

Nested objects become columns joined with a dot, such as address.city, unless you turn flattening off. Arrays, and objects when flattening is off, are written into the cell as JSON text, and the notes list which keys this applied to.

Does it handle semicolon or tab separated files?

Yes. The delimiter is detected automatically, so files exported from European versions of Excel with semicolons, and tab separated files, convert the same way.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser. You can disconnect from the internet after the page loads and it will still work.

Related tools and how they differ

  • CSV to SQL: Use it when the rows are headed for a database table rather than an API or a config file.
  • CSV to Excel Converter: Use it when the destination is a spreadsheet and you want typed columns and formatting rather than plain text.

Further reading

  • Why Parsing CSV Is Harder Than It Looks (RFC 4180)11 min read
  • CSV Data Processing: Tips for Handling Large Datasets10 min read

Private by design

Rows and columns are parsed and transformed in memory in your browser. No record ever reaches a server.