FormatKit converts in your browser

Use the API

One POST is enough: send from, to and the text, get the result back. No signup, no token.

What it does and does not do#

Included Text and data formats: CSV, TSV, JSON, JSONL, Markdown, HTML, XML, plain text.

Not included Images, PDF and audio are not part of the API: they need the browser’s decoders and canvas. Use the web pages for those — files never get uploaded.

Fastest call#

curl · macOS / Linux
curl -sS https://www.file2file.net/api/v1/convert \
  -H 'content-type: application/json' \
  -d '{"from":"csv","to":"json","data":"id,name\n1,Alice\n2,Bob\n"}'

This curl runs as-is (the host is this site). On Windows call curl.exe — in PowerShell curl is an alias for Invoke-WebRequest and lines continue with a backtick; the full version is in the Samples tabs below. Change only data inside -d; newlines in JSON are written as \n.

Base URL and auth#

Base URLhttps://www.file2file.net

No token, no signup, no API key. Protection comes from a body size cap, a per-IP burst budget and a method allowlist — see Limits below.

Cross-origin calls are allowed (CORS) and preflight is handled by OPTIONS, so a browser page can fetch this API directly.

Endpoints#

  • POST /api/v1/convert Convert a piece of text: send from / to / data in the body
  • GET /api/v1/formats List every supported pair and the limits
  • GET /api/v1/health Liveness: version and current time

Four endpoints, one job each: convert, capabilities, health, root. Fetch the capabilities once and cache it at start-up.

Supported pairs#

The second format on each row is the value for to.

FromToResponse typeNote
<code>csv</code>jsonapplication/jsonheader row to objects
<code>csv</code>tsvtext/tab-separated-valuescommas to tabs
<code>csv</code>txttext/plainflatten the table to plain text
<code>tsv</code>csvtext/csvtabs to commas
<code>tsv</code>jsonapplication/jsontab table to objects
<code>json</code>csvtext/csvobjects to CSV, union of keys
<code>json</code>tsvtext/tab-separated-valuesobjects to a tab table
<code>json</code>txttext/plainflatten JSON to plain text
<code>jsonl</code>csvtext/csvone object per line to CSV
<code>md</code>htmltext/htmlMarkdown to a complete HTML document
<code>md</code>txttext/plaindrop the markup, keep the prose
<code>html</code>txttext/plainstrip tags, keep text
<code>xml</code>txttext/plaintext content out of XML
<code>txt</code>htmltext/htmlplain text to HTML, line breaks kept

Try it here#

This text is sent to the server for conversion (the file converter never uploads). Use test data only.

No request sent yet
Output 0

      

Request parameters#

from, to and data are required; the rest are optional and can also be passed as query parameters (handy for pipes and curl).

ParameterWhereTypeRequiredNotes
<code>from</code>bodystringrequiredSource format, e.g. csv, markdown, html.
<code>to</code>bodystringrequiredTarget format; must be one of the pairs listed by /api/v1/formats.
<code>data</code>bodystringrequiredThe text to convert (not a file path).
<code>eol</code>querylf | crlfoptionalOutput line endings: lf or crlf. Defaults to crlf.
<code>delimiter</code>querystringoptionalDelimiter for tabular output (e.g. ; or \t).
<code>bom</code>query1optionalPass 1 to prefix the output with a UTF-8 BOM (for Excel).
<code>format</code>queryrawoptionalPass raw to receive the converted text directly, without the JSON envelope.

Limits and fair use#

LimitValue
Max body256 KB
Max rows20000
Burst per IP30 / 60s

What keeps it safe without a token

  • hard body-size and row-count caps inside the Worker
  • short-window rate limit per source IP (best effort, inside the Worker)
  • Cloudflare rate limiting rules, Bot Fight Mode and managed WAF rules
  • nothing is stored: logs carry only method, path, status and duration

The server keeps no request content; logs hold only method, path, status and timing.

Error codes#

CodeStatusMeaning
bad_request400malformed request: from/to/data missing or incompatible
unsupported_pair400unsupported pair, see GET /api/v1/formats
bad_json400data is not valid JSON
empty_data400data is empty
too_large413body over 262144 bytes
too_many_rows413over 20000 rows
unsupported_media415content-type not supported, use application/json or text/*
rate_limited429too many requests, slow down and retry
method_not_allowed405method not allowed here
not_found404no such endpoint
server_error500conversion failed on the server

Failure (4xx / 5xx)

Errors always use the same envelope: ok is false, error.code is safe to branch on, error.message is a human-readable English sentence.

Failure (4xx / 5xx)
{
  "ok": false,
  "error": {
    "code": "unsupported_pair",
    "message": "This pair is not supported. See /api/v1/formats for the list."
  }
}

Examples#

curl -sS https://www.file2file.net/api/v1/convert \
  -H 'content-type: application/json' \
  -d '{"from":"csv","to":"json","data":"id,name\n1,Alice\n2,Bob\n"}'

Success (200)

data holds the converted text. Add ?format=raw to get the raw text instead of the JSON envelope. bytes is the size of data; quota.remaining is your own remaining budget for the current minute - the number in the sample is just what it happened to be.

Success (200)
{
  "ok": true,
  "api": "v1",
  "from": "csv",
  "to": "json",
  "mime": "application/json",
  "bytes": 89,
  "data": "[\n  {\n    \"id\": \"1\",\n    \"name\": \"Alice\"\n  },\n  {\n    \"id\": \"2\",\n    \"name\": \"Bob\"\n  }\n]\n",
  "quota": { "remaining": 49, "windowMs": 60000 }
}

Envelope fields

ParameterNotes
<code>ok</code>true on success, false on failure (details live in error).
<code>data</code>The converted text.
<code>mime</code>MIME type of the result.
<code>bytes</code>Size of the result in UTF-8 bytes.
<code>quota</code>Burst budget left for your IP in the current window.
<code>error.code</code>Machine-readable error code; see the table above.
<code>error.message</code>One English sentence for humans and logs.

Back to the converter