Convert CSV File to JSON

Upload your CSV Files and convert them into JSON files for free. No sign up required.

How to Convert CSV File to JSON

  • Upload your CSV file by dragging and dropping it or clicking the "Upload CSV File" button.
  • Wait for the file to be processed. This may take a couple of seconds.
  • Once the file is processed, you can view the data in the table.
  • You can export the data to CSV, JSON, and Excel by clicking the "Export" button.
  • You can search and filter the data in the table by clicking the "Search" button.

Features of CSV Viewer

Unlimited file size and views

You can upload files of any size and view them without any limits.

Best in class performance

Built with the latest technologies to provide the best performance.

Secure and private

Your data is secure and private. Everything happens in your browser.

Search and filter

Search and filter your CSV file to find the data you need.

Quick export

Quickly export your CSV file to TSV, JSON, and other formats.

No sign up required

You can use CSV Viewer without creating an account.

Benefits of CSV File Format

  • CSV is a tabular format that is optimized for ease of use.
  • CSV is a free to use format that is widely used across many applications.
  • It does not need any schema to be defined.
  • CSV is a text format that is more efficient than JSON.

How to Convert CSV File to JSON Programmatically

How to Convert CSV File to JSON File using Pandas

Python code to convert a CSV file to a JSON file using Pandas.

# Import Pandas library
import pandas as pd

# Read the CSV file
df = pd.read_csv('data.csv')

# Print the data
print(df)

# Convert the CSV file to a JSON file
df.to_json('output.json', orient='records')

How to Convert CSV File to JSON File using CSV Library

Python code to convert a CSV file to a JSON file using CSV library.

# Import CSV library
import csv

rows = []
# Read the CSV file
with open('data.csv', 'r') as file:
    reader = csv.DictReader(file)
    # Iterate over the rows
    for row in reader:
        rows.append(row) # Each row is a dictionary

print(rows)

# Convert the CSV file to a JSON file
import json
with open('output.json', mode='w', encoding='utf-8') as file:
    json.dump(list(rows), file)

How to Convert CSV File to JSON File using DuckDB

Python code to convert a CSV file to a JSON file using DuckDB.

# Import DuckDB library
import duckdb

# Read the CSV file
result = duckdb.sql("SELECT * FROM 'data.csv'")

# Print the data
print(result)

# Convert the DuckDB Table to a JSON file
duckdb.sql("COPY result TO 'output.json' (ARRAY)")