ForHosting KIT · Developer Utilities

Text to Base64

“Hello, world!” becomes SGVsbG8sIHdvcmxkIQ== in standard Base64, with the classic plus, slash and equals-sign padding, and any valid Base64 string turns back into readable UTF-8 text, accents and emoji included. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello, world!
You get
Result
SGVsbG8sIHdvcmxkIQ==
Calculation mode
Encode
Padding
standard
Bytes
13

encode or decode with standard padding, free

What Base64 does to your text

Base64 rewrites any bytes using a safe set of 64 characters: A to Z, a to z, 0 to 9, plus and slash, with equals signs as padding at the end. That lets a piece of text travel through forms, email headers and configuration files without being mangled. This tool first turns your text into UTF-8 bytes, so accented letters, other alphabets, emoji and punctuation all come back intact, and then applies the standard alphabet from RFC 4648. Hello, world! is 13 bytes and becomes SGVsbG8sIHdvcmxkIQ==. The same text always gives the same result, and an empty text gives an empty result.

When to use it and what to watch for

A typical use is preparing a short configuration value for an environment variable or a support ticket, then decoding it on the other side to confirm nothing changed. Another is checking that a sample in your documentation still decodes to the text it claims. Decoding is strict: a character outside the alphabet, broken padding or bytes that are not valid UTF-8 text stop with a clear message instead of returning garbage. Keep the equals signs when you copy a result, because removing them breaks the padding. This is the classic alphabet with plus, slash and equals signs, not the URL-safe variant.

Everyday uses and practical limits

Call the free in-browser text to Base64 tool for classroom demos, support playbooks, and one-off conversions without installing OpenSSL or language runtimes. A typical workflow encodes a short configuration value for storage in an environment variable, ships it through a ticket system, then decodes it on the receiving service with mode decode and asserts that bytes match the original length. Another workflow verifies that a documentation sample still decodes to the documented plaintext before a release.

Authors shipping SDKs can map the result field straight into a copy button, while mode and padding labels make screenshots and OpenAPI examples self-explanatory for readers who only know the classic alphabet with equals signs.

How do I convert text to Base64?

The result field contains standard Base64 with padding.

How do I decode Base64 to text?

Send mode decode and put the Base64 string in text.

Does this use URL-safe Base64?

No. Only the standard alphabet (+ and /) with optional = padding is accepted. URL-safe characters are rejected as invalid input.

Is the text to Base64 tool free?

The browser tool runs free on your device.

Can I convert emoji or accented text to Base64?

Yes. Your text is turned into UTF-8 bytes before encoding, so accented letters, other alphabets, emoji and punctuation all survive the round trip and decode back exactly as you typed them.

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/enc/base64

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.

curl -X POST https://api.kit.forhosting.com/enc/base64 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello, world!"}'
{
  "text": "Hello, world!"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.base64",
  "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.

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.

Base64 turns arbitrary bytes into a safe ASCII alphabet of letters, digits, plus, slash, and equals padding so text can travel through JSON, forms, email headers, and configuration files without corruption. This capability focuses on the everyday job people type into search: convert plain text to Base64, or turn a Base64 string back into readable UTF-8, with a single mode field and classic standard padding. Encoding is deterministic UTF-8 then RFC 4648; decoding rejects illegal alphabet characters, broken padding, and non-UTF-8 payloads with a clear invalid input error instead of silent garbage.

Encode text to standard Base64 with padding

The engine interprets the string as Unicode text, serializes it to UTF-8 bytes, and maps those bytes to the sixty-four character alphabet A through Z, a through z, zero through nine, plus, and slash. Empty strings are valid: they encode to an empty Base64 result with zero bytes. Multilingual text, emoji, and punctuation all round-trip because the path is full UTF-8, not a Latin-1 shortcut. Identical inputs always produce identical outputs because the algorithm is pure arithmetic with no network, no random salt, and no wall clock. Send a JSON body with the required string field text set to the plain message you want to protect for transport, and leave mode at its default encode or set mode to encode explicitly. When the byte length is not a multiple of three, one or two equals signs are appended so every output is a multiple of four characters—this is standard padding, the form most HTTP APIs, data URLs for text snippets, and classic tutorials expect. Optional aliases input, value, and s are accepted for the same field when you generate clients from older form names. The response always includes result with the Base64 string, mode equal to encode, padding equal to standard, and bytes equal to the UTF-8 length before encoding so you can assert payload size in tests. Use this path whenever you need a paste-safe representation of a secret fragment, a config token, or a small JSON snippet that must survive a text-only channel.

Decode Base64 back to text and handle invalid input

Set mode to decode and put a standard Base64 string in text. Successful decode returns result as the recovered string, mode decode, padding standard, and bytes as the decoded UTF-8 length. Prefer this capability when your search intent is literally text to base64 or base64 to text for human-readable content; binary image data URIs belong to image-oriented tools, and URL-safe cookies belong to specialized encoders. Leading and trailing spaces, tabs, and newlines are stripped so multi-line pastes still work, but any other character outside the standard alphabet causes an immediate invalid_input failure—the engine does not silently remap URL-safe minus and underscore variants, because that would blur the product promise of standard padding and alphabet. Padding equals signs may be present or omitted when the remainder is legal; more than two pads, pads in the middle, or a length whose modulo four is one are rejected with an explicit message so clients can fix the payload. After alphabet validation, the bytes are decoded as UTF-8 with a fatal decoder: if the payload is not valid Unicode text, you get invalid_input instead of replacement characters that would corrupt downstream displays. Validation failures are not charged on the prepaid API, so probing a suspicious token is cheap for operators and safe for end users.

API usage, pricing, workflows, and practical limits

Use the prepaid KIT API when a backend, serverless function, or SDK needs the same encode or decode step under balance at $0.002 per successful item; failed validation never consumes balance after the engine rejects the request. Pair this endpoint with URL percent-encoding tools when a string must survive both Base64 and query-string rules, but keep the steps separate so each landing page matches a single search intent.

Config and secret fragments in text channels

Encode short UTF-8 tokens so they survive email, chat, and JSON without corruption, then decode on the receiving service with the same mode field.

Docs and CI golden checks

Pin encode and decode fixtures so documentation samples and continuous-integration tests fail fast if Base64 alphabet or padding ever drifts.

Support and education

Agents and students convert text to Base64 and back in the free browser widget, with clear invalid_input errors when a paste is truncated or corrupted.

What happens if the Base64 string is invalid?

Decode fails with invalid_input when the alphabet, padding, length, or UTF-8 payload is illegal. The error message describes the problem; the request is not charged.

Read the full KIT documentation →