ForHosting KIT · Unit converters

Base62 number converter

1000 in base 62 is G8: this converter turns whole numbers into short, link-friendly codes built from digits, capital letters and small letters, and decodes them back. 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
Value
1000
Conversion direction
to_base62
You get
Result
G8
Decimal
1,000
Base62
G8
Base
62

A base-62 number converter rewrites a non-negative whole number using sixty-two symbols: the ten decimal digits, twenty-six uppercase letters, and twenty-six lowercase letters. That compact alphabet is the same family of encodings used for short URLs, opaque database keys, YouTube-style identifiers, and many URL-safe tokens that need more density than base-36 without leaving the printable ASCII range. You choose a direction—decimal to base-62 or base-62 back to decimal—enter the value, and receive a deterministic result with the cleaned decimal integer, the base-62 string, and the digit count. Uppercase and lowercase letters are different digits, so a capital A is ten while a lowercase a is thirty-six. Any character outside the alphabet fails with a clear invalid-input error instead of a silent wrong answer.

How base-62 encoding and decoding work

Base sixty-two is positional notation with radix sixty-two. The standard alphabet used here is zero through nine, then uppercase A through Z for values ten through thirty-five, then lowercase a through z for values thirty-six through sixty-one. To encode a non-negative decimal integer, divide repeatedly by sixty-two and record each remainder as the next least-significant digit; reverse those remainders to obtain the usual left-to-right string without leading zeros except for the number zero itself.

To decode, walk the string from left to right, multiply the running total by sixty-two, and add the digit value of the next character—the classic Horner scheme. Because uppercase and lowercase map to different values, the conversion is case-sensitive: mixing case changes the number, and an invalid character such as a space, plus sign, slash, or punctuation mark aborts with invalid input naming the bad character and its position. Values must stay inside JavaScript’s safe integer range so every digit remains exact when the result is serialized.

Negative inputs are rejected on purpose; short-link and opaque-id use cases are unsigned, and a leading minus would collide with the idea of a pure base-62 alphabet. If you need arbitrary bases from two through thirty-six with case-insensitive letters, that is a different search intent served by a general radix converter rather than this base-62-specific landing.

Where base-62 converters show up in real work

Product and growth teams compress sequential identifiers into short path segments so marketing links stay readable while remaining dense enough for large catalogs. Backend services mint opaque public keys that avoid leaking auto-increment sequences, using base-62 so the token stays URL-safe without percent-encoding. Content platforms document how video or object ids map between internal integers and public alphanumeric strings, and engineers need a shared oracle that treats capital and lowercase letters as distinct digits.

Computer science courses introduce positional notation beyond base sixteen; a dedicated base-62 tool clarifies why sixty-two symbols need both letter cases while base thirty-six does not. QA and integration tests generate expected short codes for deep links and assert round-trip equality from decimal to base-62 and back. Treat general multi-base radix tables, pure Base64 binary encoding, and fixed-width two’s-complement packing as separate search intents with their own landings rather than stretching this integer base-62 converter past its honest scope.

Short URLs and compact public ids

Encode sequential or snowflake integers into dense base-62 path segments for short links and shareable object identifiers.

What alphabet does this base-62 converter use?

The sixty-two characters 0-9, A-Z, then a-z in that order. Uppercase and lowercase are different digits (A is 10, a is 36). There is no padding character.

What happens on an invalid base-62 character?

The message names the bad character and its position. Only 0-9, A-Z, and a-z are allowed; spaces, punctuation, and signs are rejected.

Is this the same as Base64 or radix conversion up to base 36?

No. Base64 encodes binary bytes with a different alphabet and padding. General radix converters typically stop at base 36 and treat letter case as interchangeable. This page is for integer base-62 with case-sensitive digits.

What does it cost?

The browser tool is free and runs locally.

What is 1000 in base 62?

1000 in base 62 is G8. Decoding G8 gives 1000 again, and zero stays zero, so you can check a short code in both directions before you use it.

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/fmt/base62

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/fmt/base62 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"1000","direction":"to_base62"}'
{
  "value": "1000",
  "direction": "to_base62"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "fmt.base62",
  "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_abs9007199254740991
max_base62_chars11
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.

Pricing for successful API calls is the published base of $0.002 per item.

How base-62 encoding and decoding work

The algorithm uses exact integer arithmetic only: no floating-point rounding, no random seeds, no wall-clock timestamps, and no network calls, so identical inputs always produce identical JSON.

What you send and what you get back

Send two required fields: value and direction. Absolute decimal values larger than Number.MAX_SAFE_INTEGER are rejected so low-order digits cannot silently disappear. Examples include one thousand encoding to G8, zero staying zero, and decoding G8 back to one thousand. Direction must be to_base62 when value is a non-negative decimal integer, or from_base62 when value is a base-62 string. Aliases are accepted so forms and scripts can use the names that fit their UI: value also accepts n, number, input, text, decimal, and base62; direction also accepts dir, mode, and op, plus short synonyms such as to, from, encode, and decode. For to_base62, value may be a JSON integer or a digit string with an optional leading plus; fractions, scientific notation, bare words, NaN, Infinity, and negatives fail with invalid_input and are not charged. For from_base62, every character must belong to the alphabet zero-nine, A-Z, a-z; any other character—including underscore, hyphen, and space—fails with a message that names the invalid base-62 character. On success the response echoes the cleaned value string, the normalized direction, decimal as a number, base62 as the compact string, result as the primary converted form (base-62 when encoding, decimal string when decoding), the full alphabet string, base set to sixty-two, and digit_count for the base-62 representation. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where base-62 converters show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Opaque API keys and tokens

Map internal non-negative integers to case-sensitive alphanumeric strings that stay URL-safe without leaking sequence structure.

Teaching and round-trip fixtures

Check homework on positional bases and generate golden decimal ↔ base-62 pairs for unit tests and interview warm-ups.

How do I choose the direction?

Use to_base62 when value is a non-negative decimal integer and you want a base-62 string. Use from_base62 when value is already base-62 and you want the decimal integer back.

Read the full KIT documentation →