Convert CSV to Parquet

Convert your csv files to parquet format with our free online converter. No installation required.

Files

Click anywhere to select filesor drag and drop files here
Accepts CSV files

Trusted by over 40,000 every month

How to convert CSV to Parquet

  1. Upload all of the CSV files you want to convert

    You can select multiple files at once or drag and drop a batch of files. All files will be converted simultaneously.

  2. Wait for the conversion process to complete
  3. Download your converted Parquet files
  4. Process hundreds of files in a single batch

    Our converter handles large batches efficiently, saving you time compared to converting files one by one.

Converter Features

Fast conversion
Convert your csv files to parquet in seconds, even with large datasets
Batch processing
Upload and convert hundreds of files at once with no file size limitations
Downloadable results
Get all your converted files immediately after conversion
Data integrity
Preserve your data structure and types during conversion with high-fidelity transformations
Format optimization
Automatically optimize output files for size and performance based on the target format
No code required
Convert files without writing a single line of code, perfect for data analysts and business users

How to convert CSV to Parquet in Python

We can convert CSV to Parquet in Python using Pandas, DuckDB, or ClickHouse

How to Convert CSV to Parquet using Pandas

First, we need to install pandas

pip install pandas

Then we can load the csv file into a dataframe

df = pd.read_csv('path/to/file.csv')

Finally, we can export the dataframe to the parquet format

df.to_parquet('path/to/file.parquet', index=False)

How to Convert CSV to Parquet using DuckDB

First, we need to install duckdb for Python

pip install duckdb

The following DuckDB query will read a csv file and output a parquet file

duckdb.sql("""COPY (select * from 'path/to/file.csv') TO 'path/to/file.parquet' (FORMAT 'parquet')""")

How to Convert CSV to Parquet using ClickHouse

First, we need to install the ClickHouse client for Python

pip install clickhouse-connect

Then we can use ClickHouse to convert from CSV to Parquet

Start by importing the necessary libraries and connecting to ClickHouse:

import clickhouse_connect
import os
# Connect to ClickHouse
client = clickhouse_connect.get_client(host='localhost', port=8123)

Define your input and output file paths:

# Define input and output file paths
input_file = 'path/to/input.csv'
output_file = 'path/to/output.parquet'

Now perform the direct conversion from CSV to Parquet:

# Direct conversion from CSV to Parquet
client.command(f'''
INSERT INTO FUNCTION file('{output_file}', Parquet)
SELECT *
FROM file('{input_file}', 'CSV', 'column1 String, column2 String, column3 String')
''')

Confirm the conversion was successful:

print(f'Successfully converted {input_file} to {output_file}')

For more complex conversions or when you need to transform the data during conversion, you can use a table:

First, create a table from the input file:

# Create a table from the input file
client.command(f'''
CREATE TABLE IF NOT EXISTS conversion_data AS
SELECT * FROM file('{input_file}', 'csv')
''')

Then, perform any transformations and export to the destination format:

# Now you can perform transformations if needed
client.command(f'''
INSERT INTO FUNCTION file('{output_file}', 'parquet')
SELECT * FROM conversion_data
# Add WHERE, GROUP BY, or other clauses as needed
''')

Finally, clean up by dropping the temporary table:

# Clean up
client.command('DROP TABLE IF EXISTS conversion_data')
print(f'Successfully converted {input_file} to {output_file}')