MySQL to CSV Converter

Transform MySQL database dumps into CSV files with flexible formatting options

MySQL Input

Delimiter Presets

CSV Output

About MySQL to CSV Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to CSV (Comma-Separated Values) format with full control over delimiters, quotes, and formatting options. Perfect for importing MySQL data into spreadsheets, analytics tools, and other databases.

Key Features

  • Custom Delimiters: Comma, semicolon, tab, pipe, or any custom character
  • Quote Control: Customize quote character and escaping behavior
  • Line Endings: Choose between LF (Unix/Mac) or CRLF (Windows)
  • Header Options: Include or exclude header row from MySQL column names
  • Proper Escaping: Automatically quotes fields containing delimiters or newlines
  • RFC 4180 Compliant: Follows CSV standard specifications
  • Smart Parsing: Extracts column names and data from MySQL dumps
  • File Download: Save as .csv file for Excel, Google Sheets, etc.

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Choose Delimiter: Select from presets or enter custom delimiter
  3. Configure Options: Set quote character, line endings, and header inclusion
  4. Review Output: The CSV updates automatically
  5. Download or Copy: Save as .csv file or copy to clipboard

Delimiter Options

  • Comma (,): Standard CSV format (most common)
  • Semicolon (;): European CSV format
  • Tab (\t): TSV (Tab-Separated Values) format
  • Pipe (|): Alternative delimiter for data with commas
  • Custom: Any character or sequence up to 5 characters

Example Conversion

MySQL Input:

CREATE TABLE employees (
  id INT,
  name VARCHAR(100),
  age INT,
  city VARCHAR(50)
);

INSERT INTO employees VALUES (1, 'John Doe', 28, 'New York');
INSERT INTO employees VALUES (2, 'Jane Smith', 34, 'London');

CSV Output (Comma delimiter):

id,name,age,city
1,John Doe,28,New York
2,Jane Smith,34,London

CSV Output (Tab delimiter):

id	name	age	city
1	John Doe	28	New York
2	Jane Smith	34	London

Common Use Cases

  • Excel Import: Convert MySQL data for Microsoft Excel
  • Google Sheets: Import database dumps into Google Sheets
  • Database Migration: Export MySQL data for import into other databases
  • Data Analysis: Convert MySQL data for R, Python, or MATLAB analysis
  • Backup & Archive: Create portable CSV backups of MySQL data
  • Reporting: Generate CSV reports from MySQL query results

CSV Standards

This converter follows RFC 4180 CSV standards:

  • Fields containing delimiters, quotes, or newlines are quoted
  • Quotes within fields are escaped by doubling them
  • Each record is on a separate line
  • Optional header row as first line (from MySQL column names)
  • Consistent number of fields per record

Special Character Handling

  • Delimiters in Data: Automatically quoted
  • Quotes in Data: Escaped by doubling (e.g., " becomes "")
  • Newlines in Data: Preserved within quoted fields
  • NULL Values: Converted to empty strings

Supported MySQL Syntax

  • CREATE TABLE: Extracts column names for CSV headers
  • INSERT INTO: Parses data values from INSERT statements
  • Data Types: Handles all MySQL data types (VARCHAR, INT, DECIMAL, DATE, etc.)
  • Quoted Strings: Handles single and double quotes with proper escaping

Privacy & Security

All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.