CSV field quoter
The cell He said "Hi", friend becomes "He said ""Hi"", friend": wrapped in double quotes with each inner quote doubled, as RFC 4180 requires, so commas and quotes never shift your columns. It also turns a quoted cell back into plain text. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- He said "Hi", friend
- Calculation mode
- Quote
- Result
- "He said ""Hi"", friend"
- Length
- 24
CSV looks simple until a product name contains a comma, a note holds a double quote, or a cell spans two lines. One misquoted field breaks parsers, spreadsheets, and data pipelines in ways that are hard to spot after the fact. Use it when you need a reliable oracle for one cell—not a full CSV parser—before you assemble or split rows elsewhere.
How RFC 4180 quotes a single CSV field
RFC 4180 defines CSV as records of fields separated by commas, with optional double-quote enclosure for fields that would otherwise be ambiguous. A field that contains a comma, a double quote, a carriage return, or a line feed must be enclosed in double quotes. Inside a quoted field, a literal double quote is written as two double quotes in a row—never as a backslash escape.
Fields that contain none of those special characters may be left bare, though producers are free to quote every field for uniformity. This capability implements that contract for exactly one field token. In quote mode it scans the raw value for comma, quote, CR, and LF; if any appear, or if force is true, it builds a quoted token by wrapping the text and replacing each embedded quote with a doubled pair.
If none appear and force is false, the raw value is returned unchanged so simple identifiers stay compact. In unquote mode a leading double quote means the whole token is quoted: the trailing character must also be a double quote, every interior quote must appear as a pair, and the recovered body is returned without the outer enclosure.
A bare token with no leading quote is returned as-is, but a bare token that still contains a quote character is rejected because that shape is not a legal unquoted field under RFC 4180.
What you can do with it
Safe cells in generated CSV rows
Quote each free-text product name, note, or address before joining columns so commas and quotes never shift the row layout.
FAQ
How do I quote a CSV field with embedded quotes?
Send the raw field in text with mode quote (default). Any comma, double quote, CR, or LF triggers enclosure; interior quotes become "". Example: He said "Hi" becomes "He said ""Hi""".
How do I unquote a CSV field?
Send the encoded field token with mode unquote. Quoted tokens must start and end with double quotes; doubled quotes inside become a single quote in the result.
When is force useful?
Set force true in quote mode to wrap every field, even simple words with no special characters. Some producers prefer uniform quoting for every cell; leave force false to quote only when RFC 4180 requires it.
Does this parse a whole CSV file?
No. This capability quotes or unquotes exactly one field token.
When does a CSV cell need quotes?
Only when it contains a comma, a double quote, a carriage return or a line feed. Otherwise the value comes back unchanged, so simple identifiers stay compact, unless you choose to quote every cell for a uniform layout.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/csv-quote \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"He said \"Hi\", friend"}'const res = await fetch("https://api.kit.forhosting.com/enc/csv-quote", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "He said \"Hi\", friend"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/csv-quote",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "He said \"Hi\", friend"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/csv-quote", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"He said \\"Hi\\", friend"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"He said \"Hi\", friend"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/csv-quote", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "He said \"Hi\", friend"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.csv_quote",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This CSV field quoter applies RFC 4180 rules to a single field at a time: quote mode wraps the value in double quotes and doubles every embedded quote when the field needs it (or always when you force quoting); unquote mode reverses that encoding and fails immediately with invalid_input on unclosed or half-escaped tokens instead of inventing garbage.
How RFC 4180 quotes a single CSV field
The path is pure string work with no network, no random seeds, and no wall-clock timestamps, so identical inputs always produce identical JSON. Pricing for successful API calls is the published base of $0.002 per item, and validation failures do not consume prepaid balance.
What you send and what you get back
Send a required string field named text and optional mode and force fields. Mode quote converts raw cell text into an RFC 4180 field token stored in result. Mode unquote reverses quoting in text and returns the recovered plain value in result. Force defaults to false so quote mode only wraps when the field contains a comma, quote, CR, or LF; set force true when your producer always quotes every cell for a uniform layout. Classic checks include quoting a greeting that embeds both quotes and a comma, unquoting the resulting token back to the original characters, force-quoting a plain word that would otherwise stay bare, and rejecting a quoted string that never closes. When mode is omitted, quote is the default so a single payload still does useful work. The response echoes mode, force, the original text, result, quoted (whether the result or input token is quoted), needs_quotes (whether the raw value requires quoting under RFC 4180), and the length of result. Missing text, non-string objects, unsupported mode values, values that cannot be read as a boolean for force, strings longer than the documented maximum, unclosed quoted fields, single unescaped quotes inside a quoted body, and bare fields that illegally contain a quote character all fail with invalid_input and a clear English message. Validation failures do not consume prepaid balance. Successful API pricing is the published base of $0.002 per item.
Where a single-field CSV quoter earns its keep
Code generators and ETL jobs that build CSV rows cell by cell must quote each free-text field before joining with commas, or a single product title with a comma will shift every column that follows. Spreadsheet import helpers and support tools paste one messy cell at a time and need a reversible path that fails loudly on half-quoted tickets instead of silently truncating. Curriculum authors teaching data hygiene want a dedicated page for field-level quoting rather than burying the rule under a full multi-row CSV cleaner, because search intent differs: people looking for csv field quote unquote want the escape rules, not column rename or dedupe. Failed validation does not consume balance. Localization and content pipelines that inject user-authored phrases into export templates can call this parse endpoint from edge workers without standing up a spreadsheet engine. Keep each request to one field, pin the result strings in tests, and you get reproducible quoting for generators, LMS plugins, and edge workers without pulling a full CSV framework for a single cell. If you need whole-file clean, join, or JSON conversion, treat those as separate search intents and landings rather than overloading this field quoter page.
Integration use cases
Decode a single quoted cell
Unquote one RFC 4180 field token from a log, ticket, or fixture back to readable text, with hard failures on unclosed or half-escaped quotes.
Golden tests for CSV libraries
Generate and verify quote and unquote vectors that match RFC 4180 doubling rules across languages and spreadsheet exporters.
Technical questions
What does the CSV field quoter cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.