ToolBox.Online

Text to CSV Converter - Free Online Tool

Convert plain text to CSV format online for free. Split text by delimiter, lines, or custom separator into proper CSV files.

What is Text to CSV?

CSV (Comma-Separated Values) is one of the most universal data formats, supported by virtually every spreadsheet application (Excel, Google Sheets, LibreOffice), database system, and programming language. A CSV file stores tabular data as plain text, with each line representing a row and values separated by commas (or other delimiters). Converting text to CSV is a common task when you have data in an unstructured or semi-structured format (like log files, copied table data, or plain text lists) and need to import it into a spreadsheet or database. The conversion process involves splitting text into rows and columns based on delimiters and applying proper CSV quoting rules. Proper CSV formatting follows RFC 4180, which specifies that fields containing commas, double quotes, or newlines must be enclosed in double quotes, and any double quotes within a field must be escaped by doubling them ("").

How to Use Text to CSV

Paste your text into the input area. Choose your delimiter — comma, tab, space, semicolon, pipe, or enter a custom character. Click "Convert" to transform the text into properly formatted CSV with correct quoting for fields that contain commas or quotes. Preview the result in the output area, then download it as a .csv file or copy to clipboard.

How Text to CSV Works

The converter processes your text through these steps: 1. Split the input into rows based on line breaks (\n or \r\n) 2. For each row, split the text into fields using your chosen delimiter 3. Apply RFC 4180 CSV quoting rules: • Fields containing commas are wrapped in double quotes • Fields containing double quotes have them escaped (doubled) • Fields containing newlines are wrapped in double quotes 4. Join the fields with commas to form proper CSV rows 5. Combine all rows into the final CSV output The converter handles edge cases like empty fields, trailing delimiters, and mixed line endings. The output is compatible with Excel, Google Sheets, and any RFC 4180-compliant CSV parser.

Common Use Cases

  • Converting copied table data from websites or PDFs into CSV for spreadsheet import
  • Transforming log file entries into structured CSV for analysis
  • Preparing text data for import into databases (MySQL, PostgreSQL, SQLite)
  • Converting space-separated or tab-separated data from terminal output into standard CSV
  • Creating CSV files from text lists for mail merge or bulk operations
  • Reformatting data exports from one system into CSV for import into another

Frequently Asked Questions

What delimiters are supported?

You can use commas, tabs, spaces, semicolons, pipes (|), or any custom character as the input delimiter. The output is always standard comma-separated CSV.

Can I download the CSV file?

Yes. After conversion, you can download the result as a .csv file that opens directly in Excel or Google Sheets, or copy the CSV text to your clipboard.

How does it handle fields with commas?

Following the CSV standard (RFC 4180), any field that contains a comma, double quote, or newline is automatically wrapped in double quotes. Double quotes within fields are escaped by doubling them.

Can I convert tab-separated data (TSV) to CSV?

Yes. Select "Tab" as the input delimiter and the tool will correctly split tab-separated columns into CSV format. This is useful for converting data copied from spreadsheets or terminal output.

What is the maximum file size I can convert?

Since all processing happens in your browser, the limit depends on your device memory. Most modern browsers handle several megabytes of text without issues. For very large files, consider using a command-line tool.

Does it preserve empty fields?

Yes. Empty fields (consecutive delimiters) are preserved as empty CSV columns, maintaining the correct column alignment throughout the file.

Related Tools