Skip to content
Free · Runs in your browser

CSV to JSON converter

Turn a CSV file into JSON. Each row becomes an object, numbers stay numbers, and your file never leaves your browser.

Works with
CSVTSVXLSXJSONJSONL

Drop a CSV or Excel file here

CSV, TSV or .xlsx, up to 100 MB. It stays on your computer.

  • No sign-up
  • Nothing uploaded
  • JSON or JSON Lines
  • Arla Foods logo
  • Bacardi logo
  • British American Tobacco logo
  • Everest Detection logo
  • Golden Acre logo
  • Handlangers logo
  • Inspired Learning Group logo
  • Kantar logo
  • MUFG logo
  • NielsenIQ logo
  • PTI Digital logo
  • RethinkFirst logo
  • Starbucks logo
  • The Specialist Works logo
What you get

JSON your code can use as it is.

  • Your file stays on your computer

    The JSON is written in your browser. Nothing is sent to Mammoth or anyone else.

  • The right types, column by column

    129.50 becomes the number 129.5 and true becomes a boolean. A ZIP code column keeps 02134 as text in every row.

  • Dotted columns become objects

    customer.name and customer.country turn into one customer object, the reverse of flattening JSON to CSV.

How it works

How to convert CSV to JSON

The header row gives the keys, each row below it becomes one object, and each column gets one type.

  1. 1

    Add your CSV

    Drop a .csv file on the box, choose one, or paste the CSV in.

  2. 2

    Pick the shape

    An array of objects, or JSON Lines with one object per line.

  3. 3

    Download or copy

    Save the .json file, or copy it straight into your code.

Your options

Other ways to do it

If you write code, a few lines will do it too.

  • Python with pandas

    A job you script once

    • Keeps numbers as numbersYes
    • Keeps leading zerosNo
    • No code or installNo
    • Runs on a scheduleYes
  • Python's csv module

    No libraries allowed

    • Keeps numbers as numbersNo
    • Keeps leading zerosYes
    • No code or installNo
    • Runs on a scheduleYes
  • This page

    This converter

    One-off files, no setup

    • Keeps numbers as numbersYes
    • Keeps leading zerosYes
    • No code or installYes
    • Runs on a scheduleNo
With code

How to convert CSV to JSON in Python

pandas does it in one line. Without pandas, Python's own csv and json modules take five.

Going the other way? The JSON to CSV converter flattens nested JSON into columns.

Python with pandas
import pandas as pd

pd.read_csv("orders.csv").to_json("orders.json", orient="records", indent=2)

orient="records" gives one object per row. pandas reads 02134 as the number 2134, so pass dtype={"zip": str} for code columns.

Python, no libraries
import csv, json

with open("orders.csv", newline="") as f:
    rows = list(csv.DictReader(f))

with open("orders.json", "w") as f:
    json.dump(rows, f, indent=2)

The csv module reads every value as text, so 129.50 becomes "129.50" in quotes.

Your file stays private

The converter runs inside this page. Your CSV is read and written out as JSON on your computer, and nothing is sent to Mammoth. That makes it safe for exports with customer data in them.

How we handle your data

Once the page has loaded, it works with your internet switched off.

Every month

Turning the same CSV into JSON every week?

Mammoth can do it for you. Put the CSV files in a folder and their rows are added to one table, ready to download as JSON or JSON Lines.

Try Mammoth free

Weekly exports

Shopshop.csv
Wholesalewholesale.csv
Marketplacemarketplace.csv
DriveDropboxOneDriveSFTP
All ordersUp to date
Nov 02Order 1041129.50
Nov 02Order 77101,200.00
Nov 03Order 330548.00
Nov 09Order 1077310.25
Nov 09Order 7744875.90

Illustration. Every new file in the folder is added to the same table.

Questions

CSV to JSON questions

Is my CSV sent anywhere?
No. The page reads your file and writes the JSON inside your browser. Once the page has loaded, it works with your internet switched off.
What does the JSON look like?
An array with one object per row. The header row gives the keys, so a row under order_id,total becomes { "order_id": 1041, "total": 129.5 }. Choose JSON Lines instead to get one object per line.
Are numbers kept as numbers?
Yes, when a whole column is numeric. A column that mixes numbers and text, like ZIP codes with a leading zero, stays text in every row, so 02134 keeps its zero and every value in that key has the same type. true and false become booleans, and an empty cell becomes null.
Can I get nested JSON?
Yes. Columns named with a dot, like customer.name and customer.country, become one customer object with name and country inside it. Turn off Nest dotted columns to keep them flat.
My file uses semicolons or tabs. Does that work?
Yes. The converter reads the first lines and picks the separator itself: comma, semicolon, tab or pipe.
What about commas and line breaks inside a value?
A value in quotes keeps its commas, quotes and line breaks, the way the CSV standard (RFC 4180) describes it.
Can I convert an Excel file?
Yes. Drop an .xlsx file on the same box and pick the sheet. The Excel to JSON page explains how dates and sheets are handled.
Is there a size limit?
Files up to 100 MB. The JSON is built in your browser's memory, so a very large file takes a few seconds.
Is it free?
Yes, with no account and no email.