CSV To Custom Template

Login

Email
Password

Don't have an account yet?

Go to Sign up

{{ workbook ? 'Online Table Editor' : 'Input Data' }}
Change File Enter Data
Row Col Row Col
Transpose Clear Delete Empty Deduplicate
ABC abc Abc
Replace
First Row as Header
{{ displayRows.length }} rows x {{ displayHeaders.length }} columns{{ firstRowAsHeader ? ' (1 header)' : '' }} {{ selectedRows.length > 0 ? selectedRows.length + ' selected' : '' }}
Output Data
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert CSV to Custom Template — define your output format.
Built-in Template:
Row Template, Syntax ->
Header Template:
Footer Template:
Magic Syntax:
SyntaxDescription
{h1} {h2}1st, 2th... heading field
{$1} {$2}1st, 2th... row field
{F,} {F;}Split row by delimiter
{NR}Row number from 1
{ENR}End line number
{x code}Execute JS code
{...\}Literal braces
Convert Restart
Insert Row Below
Insert Row Above
Insert Column Right
Insert Column Left
Delete Row {{ contextMenu.row + 1 }}
Delete Column {{ contextMenu.col + 1 }}
Clear Cell
Clear Row
Case sensitive Use regex Cancel Replace All

What Is the CSV to Custom Template Converter?

CSV (Comma-Separated Values) is one of the most widely used formats for exchanging tabular data between applications. However, raw CSV is rarely the final format you need. The CSV to Custom Template Converter on A.Tools lets you transform any CSV or TSV file into precisely the text format your workflow demands — SQL statements, JSON arrays, XML documents, Markdown tables, configuration files, or any arbitrary template — using a simple placeholder syntax.

All processing runs locally in your browser. No data leaves your device.


Core Features

Built-in Templates

One-click presets for common conversions:

  • SQL INSERT — Generate INSERT INTO ... VALUES (...) statements from your CSV.

  • JSON Array — Convert rows into a JSON array of objects.

  • XML — Wrap each row in XML tags using header names.

  • Markdown Table — Produce a ready-to-paste Markdown table.

  • Custom — Write your own template from scratch.

Online Table Editor

Before converting, edit your data directly in the browser:

  • Add, delete, and reorder rows and columns.

  • Transpose the entire table.

  • Remove empty rows/columns and deduplicate.

  • Change text to UPPERCASE, lowercase, or Capitalize.

  • Find & Replace across all cells.

Template Syntax

SyntaxDescription
{$1}, {$2}, {$3} ...1st, 2nd, 3rd column value in the current row
{h1}, {h2}, {h3} ...1st, 2nd, 3rd header (column name)
{NR}Current row number (starting from 1)
{ENR}Last row number (total data rows)
{F,}Split the row by , delimiter
{F;}Split the row by ; delimiter
{x code}Execute inline JavaScript (e.g., {x $1.toUpperCase()})
{...\}Output literal braces

Privacy & Security

The tool processes everything client-side using JavaScript. Files are read with the browser's File API and never transmitted over the network. There is no server-side storage or logging of your data.


How to Use the CSV to Custom Template Converter

Step 1 — Load Your Data

Upload a .csv or .tsv file by dragging it onto the upload area, or click the upload area to browse your files. Alternatively, click Enter Data to type or paste data directly into the built-in table editor.

Step 2 — Edit (Optional)

Use the toolbar above the table to modify your data:

  • Undo / Redo — Revert or reapply changes.

  • Add Row / Add Column — Expand the table.

  • Delete Row / Delete Column — Select rows or columns with the checkboxes, then delete.

  • Transpose — Swap rows and columns.

  • Delete Empty — Remove rows and columns that contain no data.

  • Deduplicate — Remove duplicate rows.

  • ABC / abc / Abc — Change the case of all cell values.

  • Replace — Find and replace text across the entire table.

  • First Row as Header — Toggle whether the first row is treated as column headers.

Step 3 — Configure Your Template

In the Properties panel on the right:

  1. Choose a built-in template from the dropdown (e.g., SQL INSERT, JSON Array), or leave it on "Custom" to write your own.

  2. Row Template — Define the output pattern for each data row. Example for SQL: INSERT INTO my_table ({h1}, {h2}, {h3}) VALUES ('{$1}', '{$2}', '{$3}');

  3. Header Template (optional) — Text that appears once before all rows. Example: [

  4. Footer Template (optional) — Text that appears once after all rows. Example: ]

Step 4 — Convert

Click the Convert button. The output appears in the Output Data panel.

Step 5 — Copy or Download

Click Copy to Clipboard to paste the result into your editor, or click Download File (Premium) to save it as a file.


Practical Examples

Example 1: CSV to SQL INSERT

Input CSV:

name,email,role

Alice,[email protected],Admin

Bob,[email protected],Editor

Row Template:

INSERT INTO users ({h1}, {h2}, {h3}) VALUES ('{$1}', '{$2}', '{$3}');

Output:

INSERT INTO users (name, email, role) VALUES ('Alice', '[email protected]', 'Admin');

INSERT INTO users (name, email, role) VALUES ('Bob', '[email protected]', 'Editor');

Example 2: CSV to JSON Array

Header Template: [
Row Template:  {"{h1}": "{$1}", "{h2}": "{$2}", "{h3}": "{$3}"},
Footer Template: ]

Output:

[

 {"name": "Alice", "email": "[email protected]", "role": "Admin"},

 {"name": "Bob", "email": "[email protected]", "role": "Editor"},

]


Frequently Asked Questions (FAQ)

  • Is my CSV data uploaded to a server?

    No. All file processing happens entirely in your browser using JavaScript. Your CSV data is never uploaded, transferred, or stored on any server.

  • What file formats are supported?

    The tool accepts .csv (comma-separated) and .tsv (tab-separated) files. You can also enter data manually through the built-in table editor without uploading a file.

  • What is the template syntax?

    Placeholders in curly braces reference your data: {$1} is the first column's value, {h1} is the first column's header, {NR} is the row number, and {x code} runs custom JavaScript. See the Syntax Reference table above for the full list.

  • Can I convert CSV to SQL INSERT statements?

    Yes. Select the "SQL INSERT" preset from the built-in template dropdown, or manually write a row template like:

    INSERT INTO table_name ({h1}, {h2}) VALUES ('{$1}', '{$2}');
  • Is there a file size limit?

    Since processing is entirely client-side, the practical limit depends on your browser and device memory. Files up to several megabytes (tens of thousands of rows) typically work without issue.

  • Can I use regular expressions in Find & Replace?

    Yes. The built-in Find & Replace tool supports regex mode. Enable it by checking the "Use regex" option in the Replace dialog.

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Free online JSON to Markdown table converter. Paste JSON or upload a .json file and instantly generate clean, formatted Markdown tables with aligned columns, bold headers, and custom text alignment — no sign-up required, 100% client-side.

JSON To Markdown Table

Free online JSON to Markdown table converter. Paste JSON or upload a .json file and instantly generate clean, formatted Markdown tables with aligned columns, bold headers, and custom text alignment — no sign-up required, 100% client-side.
Free online JSON to MATLAB converter. Generate cell arrays, numeric matrices, or struct arrays from JSON. Custom variable names, NaN handling, and transposition. 100% client-side.

JSON To MATLAB Array

Free online JSON to MATLAB converter. Generate cell arrays, numeric matrices, or struct arrays from JSON. Custom variable names, NaN handling, and transposition. 100% client-side.
Free online JSON to PDF converter. Transform JSON data into styled PDF tables with customizable themes, header colors, titles, and descriptions. 100% client-side, no sign-up.

JSON To PDF

Free online JSON to PDF converter. Transform JSON data into styled PDF tables with customizable themes, header colors, titles, and descriptions. 100% client-side, no sign-up.
Free online JSON to PHP array converter. Paste JSON data and instantly get valid PHP array syntax. Supports nested objects, arrays, and all data types. 100% client-side.

JSON To PHP Array

Free online JSON to PHP array converter. Paste JSON data and instantly get valid PHP array syntax. Supports nested objects, arrays, and all data types. 100% client-side.