Our Network


Coming Soon


Coming Later

CSV Column Replacer

world's simplest csv tool

Free online CSV column replacer. Just upload your CSV file in the form below, paste the new column in the options, and it will automatically replace the selected column in your CSV. In the tool options, you can specify the position or name of the column that you want to replace and additionally, you can clean up the CSV data from comments and empty lines, and fix incomplete CSV data. Created by programmers from team Browserling.

᠎᠎᠎          Tool Options

New Column

Specify the replacement column.
Use the same number of rows
as in the input CSV file.

Column To Replace

Enter the column number
(starting with 1), that you want
to replace with the new column.
Enter the column header, that
you want to replace with the
new column.
If there are multiple columns
with the same header, then
replace every repeated column
with the new column.

Handling of Incomplete CSV

Output format for an incomplete
CSV file with missing fields.
If you choose to fill an
incomplete CSV with custom
values, use this value to
fill in the missing fields.

CSV Cleanup

Specify the symbol that starts
comments in the input CSV.
Remove lines with no values
from the input CSV.

What Is a CSV Column Replacer?

This tool replaces a specific column in a CSV file with a new one, providing a quick way to correct outdated or inaccurate information in your CSV. To replace one column with another, you need to upload a CSV file as the input and specify the replacement column in the options. When you enter the replacement column, make sure that the height of the column matches the height of the input data to avoid incomplete data. When a column is replaced, all other columns are left unchanged. You can also replace the original column with two, three, or more new columns by specifying them in the standard CSV format in the options. You can identify the column for replacement in two ways – you can enter the column number or the column name. Column numbering starts from 1, so to replace the first CSV column with a new one, use the number "1"; to replace the second column, use "2", and so on. If you want to replace the last CSV column, you can use negative numbering that counts backwards. For example, "-1" is the last column, "-2" is the second column from the end, etc. In the column selection mode by name, you can specify the CSV column's header value (it's the value in the first row of the column). For example, the column header could be "color". In rare cases when there are multiple columns with the same name in the CSV, you can enable the "Replace All Matches" option to replace all duplicate columns with the new column. In the next options block, there are settings for handling incomplete CSV data. If some fields in the CSV are missing, you can choose one of the following options: fill missing fields with empty values or fill missing fields with custom values (the custom values can be specified next to this option). Finally, in the last section of the options, you can remove comment lines from the input CSV by entering the symbol that starts comments (such as "#" or "//") and delete empty lines from the input CSV. Csv-abulous!


CSV Column Replacer Examples

Click to try!

Replace the Third Column in CSV Data

In this example, we load a CSV file containing data about trees and replace one of its columns. We remove the third column, which contains information about tree height in meters (m) and replace it with a new column containing the height in feet (ft). The new column that we specified in the options has the same height as the input CSV, so the output CSV is fully filled with all the values.

tree,leaf_type,height_range Oak,Deciduous,15-30m Pine,Evergreen,20-50m Maple,Deciduous,10-25m Palm,Evergreen,3-30m Willow,Deciduous,10-20m
tree,leaf_type,height_range Oak,Deciduous,49-98ft Pine,Evergreen,66-164ft Maple,Deciduous,33-82ft Palm,Evergreen,10-98ft Willow,Deciduous,33-66ft
Required options
These options will be used automatically if you select this example.
Specify the replacement column.
Use the same number of rows
as in the input CSV file.
Enter the column number
(starting with 1), that you want
to replace with the new column.
Enter the column header, that
you want to replace with the
new column.
If there are multiple columns
with the same header, then
replace every repeated column
with the new column.
Output format for an incomplete
CSV file with missing fields.
If you choose to fill an
incomplete CSV with custom
values, use this value to
fill in the missing fields.
Specify the symbol that starts
comments in the input CSV.
Remove lines with no values
from the input CSV.

Replace One CSV Column with Two New Ones

In this example, we're working with chemistry data. We created a CSV file containing various chemical substances, their melting points, and formulas but unfortunately, we used a European reference book and entered the melting points in Celsius degrees and not Fahrenheit degrees. Additionally, we forgot to include the boiling point data. To fix this issue, we replace the incorrect melting point data with the correct one and add the boiling point data in one go. We achieve this by replacing the original "melting_point" column with two new columns: "melting_point" and "boiling_point" (both entered in the options in a comma-separated format). As a result, instead of the incorrect "melting_point" column measured in degrees Celsius, we get two output columns "melting_point" and "boiling_point" measured in Fahrenheit.

substance,melting_point,formula Water,0.00 °C,H2O Ethanol,-114.1 °C,C2H5OH Sodium Chloride,801 °C,NaCl Iron,1538 °C,Fe Gold,1064 °C,Au
substance,melting_point,boiling_point,formula Water,32.00 °F,211.96 °F,H2O Ethanol,−173.45 °F,172.81 °F,C2H5OH Sodium Chloride,1473.3 °F,2669 °F,NaCl Iron,2800 °F,5182 °F,Fe Gold,1947.52 °F,5378 °F,Au
Required options
These options will be used automatically if you select this example.
Specify the replacement column.
Use the same number of rows
as in the input CSV file.
Enter the column number
(starting with 1), that you want
to replace with the new column.
Enter the column header, that
you want to replace with the
new column.
If there are multiple columns
with the same header, then
replace every repeated column
with the new column.
Output format for an incomplete
CSV file with missing fields.
If you choose to fill an
incomplete CSV with custom
values, use this value to
fill in the missing fields.
Specify the symbol that starts
comments in the input CSV.
Remove lines with no values
from the input CSV.

Fix a CSV by Replacing Its Column

In this example, we use our CSV column replacement tool to fix a corrupted CSV file containing a schedule of daily activities. Instead of two separate "name" and "surname" columns, the input CSV has two duplicate "surname" columns. We enable the mode of matching a column by its title and enter the CSV header "surname" in the options. This way, we match the first "surname" column (the "Replace All Matches" option is disabled – if it was enabled, then all columns with this header would be replaced). We then replace this first "surname" column with a new one titled "name". Additionally, to clean and correct the file, we activate the options to remove comments and empty lines and fill in the missing fields with the custom value "␣".

activity,time,surname,surname Swimming,08:30,Anderson,Anderson Football,10:45,Miller,Miller Dancing,14:15,Jones,Jones Painting,09:00,Davis,Davis Chess,12:30,Johnson #Karate,09:30
activity,time,name,surname Swimming,08:30,Emily,Anderson Football,10:45,Nathan,Miller Dancing,14:15,Grace,Jones Painting,09:00,William,Davis Chess,12:30,Ava,␣
Required options
These options will be used automatically if you select this example.
Specify the replacement column.
Use the same number of rows
as in the input CSV file.
Enter the column header, that
you want to replace with the
new column.
If there are multiple columns
with the same header, then
replace every repeated column
with the new column.
Output format for an incomplete
CSV file with missing fields.
If you choose to fill an
incomplete CSV with custom
values, use this value to
fill in the missing fields.
Specify the symbol that starts
comments in the input CSV.
Remove lines with no values
from the input CSV.

Pro tips Master online csv tools

You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!

https://onlinetools.com/csv/replace-csv-columns?input=tree%2Cleaf_type%2Cheight_range%0AOak%2CDeciduous%2C15-30m%0APine%2CEvergreen%2C20-50m%0AMaple%2CDeciduous%2C10-25m%0APalm%2CEvergreen%2C3-30m%0AWillow%2CDeciduous%2C10-20m&replace-column=height_range%250A49-98ft%250A66-164ft%250A33-82ft%250A10-98ft%250A33-66ft&use-column-number=true&column-number=3&use-column-name=false&column-name=name&replace-select-all=false&incomplete-format=set-custom-value&custom-value=x&remove-comments=false&comment-character=%2523&remove-empty-lines=false

All CSV Tools

Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!

Quickly convert a CSV file to a JSON data structure.

Quickly convert a JSON data structure to a CSV file.

Quickly convert a CSV file to an XML file.

Quickly convert an XML file to a CSV file.

Quickly convert a CSV file to a YAML file.

Quickly convert a YAML file to a CSV file.

Quickly convert a CSV file to a TSV file.

Quickly convert a TSV file to a CSV file.

Quickly convert a CSV file to evenly aligned text columns.

Quickly convert text columns to a CSV file.

Quickly encode CSV to base64.

Quickly decode base64 to CSV.

Quickly convert CSV to URL-encoding.

Quickly decode CSV from URL-encoding.

Quickly change the CSV column delimiter to a new symbol.

Quickly prepend columns at the beginning of a CSV file.

Quickly append one or more new columns at the end of a CSV file.

Quickly insert one or more new columns anywhere in a CSV file.

Quickly export one or more columns from a CSV file.

Quickly replace any column in a CSV file with a new one.

Quickly delete one or more columns from a CSV file.

Quickly swap two columns in a CSV file.

Quickly exchange columns with rows in a CSV file.

Quickly exchange rows with columns in a CSV file.

Quickly transpose a CSV file.

Quickly truncate columns in a CSV file.

Quickly left-trim and right-trim column values in a CSV file.

Quickly sort data in one or more CSV columns.

Quickly remove double quotes from all CSV fields.

Quickly wrap all CSV fields in double quotes.

Quickly change the character that CSV fields are wrapped in.

Quickly make sure the given CSV file doesn't have errors.

Quickly find rows and columns in CSV that are missing values.

Quickly fill missing CSV values with placeholder values.


Coming Soon

These CSV tools are on the way!
Edit CSV in the Browser

Edit the contents of a CSV file in a neat editor.

Deduplicate CSV Data

Remove duplicate rows in a CSV file.

Print CSV Statistics

Display detailed information about a CSV file.

Convert CSV to HTML

Convert a CSV file to an HTML table.

Convert HTML to CSV

Convert an HTML table to a CSV file.

Convert CSV to Markdown

Convert a CSV file to a Markdown table.

Convert Markdown to CSV

Convert a Markdown table to a CSV file.

Convert CSV to ASCII Table

Draw an ASCII table from CSV data.

Convert CSV to ANSI Table

Draw an ANSI table from CSV data.

Convert CSV to Unicode Table

Draw a Unicode table from CSV data.

Convert CSV to PDF

Convert CSV to a PDF document.

Convert PDF to CSV

Extract data from a PDF and create a CSV file.

Convert CSV to a Screenshot

Create a screenshot of CSV data.

Convert CSV to an Image

Draw a CSV file as a PNG, JPG or GIF picture.

Convert Image to CSV

Extract data from an image and create a CSV file.

Convert CSV to Excel

Convert a CSV file to an Excel spreadsheet.

Convert Excel to CSV

Convert an Excel spreadsheet to a CSV file.

Convert CSV to vCard

Convert a CSV file to a vCard file.

Convert vCard to CSV

Convert a vCard file to a CSV file.

Convert CSV to LaTeX

Convert CSV to a LaTeX table.

Convert CSV to SQL

Generate SQL insert queries from a CSV file.

Convert SQL to CSV

Create a CSV file from SQL query results.

Convert CSV to qCSV

Convert a CSV file to a qCSV (quoted CSV) file.

Convert qCSV to CSV

Convert a qCSV (quoted CSV) file to a CSV file.

Convert CSV to INI

Convert a CSV file to an INI file.

Convert INI to CSV

Convert an INI file to a CSV file.

Convert CSV to JSONL

Convert a CSV file to a JSONL (JSON Lines) file.

Convert JSONL to CSV

Convert a JSONL (JSON Lines) file to a CSV file.

Convert CSV to TXT

Convert a CSV file to a plain text file.

Convert TXT to CSV

Convert a plain text file to a CSV file.

Convert CSV to 0SV

Convert a CSV file to a null-separated values file (0SV).

Convert 0SV to CSV

Convert a null-separated values file (0SV) to a CSV file.

Convert CSV to SSV

Convert a CSV file to a semicolon-separated file (SSV).

Convert SSV to CSV

Convert a semicolon-separated file (SSV) to a CSV file.

Convert CSV to HSV

Convert a CSV file to a hash-separated file (HSV).

Convert HSV to CSV

Convert a hash-separated file (HSV) to a CSV file.

Convert CSV to PSV

Convert a CSV file to a pipe-separated file (PSV).

Convert PSV to CSV

Convert a pipe-separated file (PSV) to a CSV file.

Convert CSV to SQLite

Create an SQLite database from the given CSV file.

Convert SQLite to CSV

Export tables from an SQLite database as CSV files.

Convert CSV to GeoJSON

Convert a CSV file to a GeoJSON file.

Convert GeoJSON to CSV

Convert a GeoJSON file to a CSV file.

Merge CSV Files

Merge together two or more CSV files.

Compare Two CSV Files

Visually show the differences between two CSV files.

Diff Two CSV Files

Run the diff algorithm on two CSV files.

Find Data in CSV

Find CSV cells that contain certain data.

Filter CSV Cells

Return data in a CSV file that matches a pattern.

Slice CSV

Extract a slice from a CSV file.

Cut CSV

Cut a fragment from a CSV file.

Rotate CSV Columns

Move CSV columns to the left or right.

Rotate CSV Rows

Move CSV data rows up or down.

Sort CSV Rows

Sort the data in one or more CSV rows.

Shuffle CSV Columns

Randomly change the positions of CSV columns.

Shuffle CSV Rows

Randomly change the order of CSV rows.

Shuffle CSV Values

Randomly change the order of all CSV values.

Rename CSV Columns

Change the name of CSV columns.

Create a Random CSV

Generate a random CSV of any size.

Create an Empty CSV File

Generate a CSV file that contains nothing.

Create a Large CSV File

Generate a large CSV file for testing.

Create a Custom CSV File

Generate a custom CSV file with m rows and n columns.

Delete Empty CSV Columns

Remove CSV columns that are completely empty.

Delete Empty CSV Rows

Remove CSV rows that are completely empty.

Delete Empty CSV Values

Remove all fields in a CSV file that are empty.

Delete Empty CSV Lines

Remove all empty lines in a CSV file.

Remove CSV Separator

Delete the comma separator from CSV files.

Remove Extra CSV Commas

Delete extra commas around CSV values.

Delete CSV Comments

Delete comments (lines starting with # or //) from CSV files.

Delete CSV Header

Delete the column header from a CSV file.

Delete First CSV Line

Delete the first line from a CSV file.

Compress a CSV File

Minify a CSV file and remove unnecessary whitespaces.

Optimize CSV File Size

Reduce the file size of a CSV file.

Change CSV Encoding

Change the character encoding of a CSV file to UTF8 or ISO-8859-1.

Add Extra Spaces in CSV

Add extra spaces between CSV columns.

Convert CSV to a Matrix

Convert a CSV file to an m-by-n matrix.

Convert CSV to an Array of Arrays

Convert a CSV file to an array of arrays of fields.

Convert an Array of Arrays to CSV

Convert an array of arrays of fields to a CSV file.

Convert CSV Columns to a List

Create a list from one or more CSV columns.

Convert CSV Rows to a List

Create a list from one or more CSV rows.

Convert CSV Columns to an Array

Create an array from one or more CSV columns.

Convert CSV Rows to an Array

Create an array from one or more CSV rows.

Find CSV Dimensions

Find the number of rows and columns of a CSV file.

Count CSV Columns

Find the number of columns in a CSV file.

Count CSV Rows

Find the number of rows in a CSV file.

Sum CSV Columns

Find the sum of CSV columns.

Sum CSV Rows

Find the sum of CSV rows.

Average CSV Columns

Find the average value of CSV columns.

Average CSV Rows

Find the average value of CSV rows.

Add Color to CSV

Use different colors for CSV data, quotes, and commas.

Animate a CSV File

Animate CSV data by showing column after column.

Fix a Broken CSV

Automatically fix a broken CSV.

Add Errors to CSV

Introduce random errors to a CSV file for fuzz testing.

Anonymize CSV Data

Hide personal or sensitive information in a CSV file.

Censor CSV Data

Mask data in a CSV file.

Hide a Message in a CSV

Hide a secret message in a CSV.

Encrypt CSV

Encrypt a CSV file and hide information in it.

Decrypt CSV

Decrypt a previously encrypted CSV file and make it readable.

Visualize CSV

Create a visual drawing that shows the CSV structure.

Create a CSV File

Create a new CSV file in the browser.

Unleash Zalgo on CSV

Distort a CSV file by infusing it with Zalgo characters.

Purge Zalgo from CSV

Neutralize the chaotic Zalgo and restore CSV integrity.

CSV Viewer

Preview the contents of a CSV file in an interactive editor.


Subscribe!

Subscribe to our updates. We'll let you know when we release new tools, features, and organize online workshops.

Enter your email here


Feedback. We'd love to hear from you! 👋