ForHosting KIT · Data & Files

Convert to UTF-8

A file that reads "Café del Mar" instead of "Café del Mar" has not lost its data, it has just been decoded with the wrong assumption, and re-encoding it blind almost always makes it worse. This endpoint detects the actual source encoding of a text file and converts it cleanly to UTF-8, undoing the mojibake instead of compounding it.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Where mojibake comes from

Text files do not carry a label saying which encoding they were saved in; a program has to guess, and for decades different systems guessed differently by default depending on the operating system, the region, and the era the file was created. A Latin-1 file opened as UTF-8, or the reverse, does not error out, it just silently produces garbled characters wherever an accented letter, a curly quote, or a non-Latin character sits, because each encoding maps the same bytes to different symbols.

What the conversion actually does

The convert to utf-8 api inspects the byte patterns in the file to identify the most likely source encoding, whether that is Latin-1, Windows-1252, one of the Shift-JIS or GBK family used historically for Japanese and Chinese text, or a handful of others still floating around in older systems, and then re-decodes and re-encodes the content correctly into UTF-8. Where a file is already garbled from a previous bad conversion, it can often reconstruct the original characters, because the corruption pattern itself is a fingerprint of what went wrong.

How the request and pricing work

POST the file to /data/to-utf8 and the call returns a task_id immediately, since encoding detection benefits from examining the file properly rather than rushing a guess. The converted, valid UTF-8 output is delivered to your signed webhook or through a signed link valid for 24 hours once the job finishes. Pricing is a flat $0.002 per request, and a job that fails after three retries is never billed.

Why UTF-8 is the answer, not just an option

UTF-8 became the dominant encoding on the web precisely because it can represent every character in the Unicode standard while staying backward-compatible with plain ASCII text, which is why modern browsers, databases, and APIs default to it and increasingly refuse to gracefully handle anything else. Converting old files to UTF-8 is not a stylistic preference, it is what makes the content portable across every system it might touch next.

Where it fits in automation

Encoding problems tend to surface at the worst possible time, deep inside a pipeline that assumed clean input, so this endpoint belongs right at ingestion: right after a file lands from an upload, an FTP import, or an old archive being migrated, and before anything parses or displays its content. Access requires prepaid balance, which keeps requests fast and the service abuse-free. This endpoint is live now.

Rescuing an old export

A data team converts a decade-old CSV export that shows broken accented characters back into clean UTF-8 before loading it into a modern analytics pipeline.

Multi-source content ingestion

A publishing platform converts articles submitted from writers using different regional text editors so every file lands in the CMS with consistent, correct encoding.

Fixing a previous bad conversion

A support team converts a file that was already mangled by an earlier incorrect encoding guess, recovering the original accented and special characters instead of leaving them garbled.

Legacy system migration

An IT team converts thousands of text files inherited from a retiring Windows-1252 based system into UTF-8 before archiving them in a new document store.

How do I convert a file to UTF-8 with an API?

POST the file to /data/to-utf8. The convert to utf-8 api returns a task_id right away and delivers the correctly encoded UTF-8 file to your webhook or a signed link once processing finishes.

Is this API free to use?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

What is mojibake and can this API fix it?

Mojibake is the garbled text that appears when a file is decoded with the wrong encoding; this endpoint detects the likely original encoding and re-converts the file, often recovering the intended characters.

Which source encodings can it detect?

It handles common legacy encodings including Latin-1, Windows-1252, and East Asian encodings such as Shift-JIS and GBK, alongside straightforward already-valid UTF-8 files.

Does it work on any file size?

Because processing is asynchronous, the endpoint is built to handle real-world files without blocking your request thread while detection and conversion run.

Can I convert many files in bulk?

Yes, each file is submitted as its own request and processed independently, so a batch of files can be converted in parallel with results delivered by webhook as each finishes.

Is the Encoding Converter API live now?

Yes, this endpoint is live today at the published price of $0.002 per request.

What happens to my file after conversion?

The submitted file and the converted output are deleted after the retention window and are never used for training. Delivery is by signed webhook or a signed link valid for 24 hours.

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.

POSThttps://api.kit.forhosting.com/data/to-utf8

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, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/data/to-utf8 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.to_utf8",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →