# CSV Transformer

Transform and process CSV data with column operations, calculations, and data type conversions. Supports renaming columns, adding calculated columns, removing columns, converting data types, calculating values, and filtering rows.

Operation examples:
• Rename column: [{"type": "rename", "column": "old_name", "new_name": "new_name"}]
• Add calculated column: [{"type": "add_column", "new_column": "total", "formula": "price * quantity"}]
• Remove column: [{"type": "remove_column", "remove_column": "column_to_remove"}]
• Convert data type: [{"type": "convert_type", "convert_column": "age", "target_type": "number"}]
• Calculate values: [{"type": "calculate", "target_column": "total", "expression": "price * tax + shipping"}]
• Filter rows: [{"type": "filter_values", "filter_column": "status", "operator": "equals", "value": "active"}]

> Canonical page: https://elysiatools.com/en/tools/csv-transformer

- **Category:** Data Processing

- **Keywords:** csv, transform, convert, calculate, columns, data processing, manipulate

## Overview

The CSV Transformer is a powerful utility designed to clean, restructure, and analyze your CSV data through precise column operations, mathematical calculations, and automated data type conversions.

## Inputs

- **CSV File** (file)
- **Transformations (JSON)** (textarea): Enter transformation operations in JSON format
- **Output Format** (select)
- **Include Header Row** (checkbox)
- **Error Handling** (select)
- **Error Reporting** (select)

## When to use

- When you need to clean or restructure large CSV datasets by removing unnecessary columns or renaming headers.
- When you must perform bulk calculations across rows, such as computing totals or applying tax rates to existing data.
- When you need to filter specific rows based on criteria or convert data types to ensure consistency for downstream analysis.

## How it works

- Upload your CSV file and define your desired operations using the JSON configuration field.
- Specify transformation rules such as renaming columns, adding calculated fields, or filtering rows based on specific values.
- Select your preferred output format and error handling strategy to ensure the processed data meets your requirements.
- Execute the transformation to generate your cleaned and structured data file.

## Use cases

- Standardizing inconsistent column names across multiple exported datasets for unified reporting.
- Automating the calculation of financial metrics like tax, shipping, or total price directly within the data file.
- Filtering large raw datasets to extract only relevant records, such as active users or completed transactions.

## Frequently asked questions

### What types of operations can I perform on my CSV?

You can rename columns, add new calculated columns, remove columns, convert data types, perform complex calculations, and filter rows based on specific conditions.

### How do I define the transformation rules?

Transformation rules are defined using a JSON array format in the 'Transformations' field, where each object specifies the operation type and relevant parameters.

### Can I output the result in a format other than CSV?

Yes, the tool supports exporting your processed data as CSV, JSON, or a summary report.

### How does the tool handle errors during processing?

You can configure error handling to either skip the problematic row, keep the original value, set it to empty, or throw an error to stop the process.

### Is there a limit to the number of transformations I can apply?

You can chain multiple operations within the JSON array to perform complex data manipulation in a single pass.

## Related tools

- [BOM Character Remover](https://elysiatools.com/en/tools/data-bom-remover): Remove BOM (Byte Order Mark) characters from text and file content. Perfect for cleaning up text files that have encoding issues, fixing CSV imports, and preparing data for processing. Features: - Detect and remove UTF-8 BOM (EF BB BF) - Detect and remove UTF-16 BOM (FE FF or FF FE) - Detect and remove UTF-32 BOM (00 00 FE FF or FF FE 00 00) - Support multiple input formats - Visual BOM character display - Detailed detection report - Support for batch text processing Common Use Cases: - Fix CSV file import errors - Clean up text file encoding issues - Prepare data for JSON parsing - Fix XML parsing problems - Resolve API data encoding conflicts - Standardize text data format
- [Data Range Limiter](https://elysiatools.com/en/tools/data-range-limiter): Limit numerical values to specified ranges by clipping, filtering, or marking out-of-bounds values. Perfect for data quality control, sensor data cleaning, business rule enforcement, and data preprocessing. Features: - Range clipping (clip values to min/max boundaries) - Range filtering (remove out-of-bounds rows) - Range marking (flag modified values) - Per-column range configuration - Automatic numeric column detection - Multiple handling strategies - Detailed modification reports - Statistical analysis of changes - Business rule enforcement Common Use Cases: - Sensor data validation and cleaning - Machine learning input preparation - Data quality control and validation - Business constraint enforcement - Outlier management and control - Data preprocessing pipelines
- [CSV File Merger](https://elysiatools.com/en/tools/csv-merger): Merge multiple CSV files into a single file with options for header handling and deduplication
- [PDF Table Extractor to CSV/JSON](https://elysiatools.com/en/tools/pdf-table-extractor-to-csv-json): Extract tables from PDFs with OpenDataLoader and export them as structured JSON, flat CSV, or HTML tables
- [CSV Data Grouper](https://elysiatools.com/en/tools/csv-data-grouper): Group CSV data by specified columns with aggregation options. Perfect for summarizing and analyzing large datasets by categories, dates, or other criteria.
- [CSV to Database Migration Planner](https://elysiatools.com/en/tools/csv-to-database-migration-planner): Infer a relational schema from CSV data and generate create-table plus ALTER migration plans for PostgreSQL, MySQL, SQLite, or SQL Server
- [Fitness Workout PDF Generator](https://elysiatools.com/en/tools/fitness-workout-pdf-generator): Generate a printable workout-plan PDF from JSON or CSV data with exercise tables, progress boxes, and optional QR video links
- [CSV Deduplicate Rows](https://elysiatools.com/en/tools/csv-deduplicate-rows): Upload a CSV file or paste CSV text, remove duplicate rows using exact or fuzzy matching, and download a cleaned CSV.

## Samples

- [CSV Samples](https://elysiatools.com/en/samples/csv-samples): Sample CSV files with various data types, sizes, and complexity levels
- [Python Samples](https://elysiatools.com/en/samples/python): Essential Python code examples and Hello World demonstrations
- [WebRTC Real-Time Communication Samples](https://elysiatools.com/en/samples/webrtc-samples): Comprehensive WebRTC samples for peer-to-peer audio/video communication, data channels, screen sharing, and signaling server implementation
- [Apache Arrow Samples](https://elysiatools.com/en/samples/arrow): Apache Arrow in-memory columnar format examples for high-performance data processing and analytics

## Related content

- [CSV Cleanup, Reshaping, and Delivery Workflow](https://elysiatools.com/en/hubs/csv-utility): Inspect CSV structure, keep the right columns, reshape rows, compare outputs, and split final files for dependable imports or reporting.
