ForHosting KIT · Developer Utilities

Fractional base converter

Decimal 0.1 is 0.0(0011) in binary: a cycle of 4 digits that repeats forever, not a rounded bit. Convert any fraction between bases 2 and 16, with the repeating block in parentheses and the length of its period. 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
0.1
From base
10
To base
2
You get
Result
0.0(0011)
Max digits
32
Non repeating
0
Period
4

Integer base converters stop at the radix point. Students, compiler writers, and embedded engineers still need the fractional half: binary 0.1 is one half, decimal 0.1 is one tenth, and the same rational becomes a different digit stream—and often a repeating cycle—when the base changes. This fractional base converter accepts a pure fraction written in any source base from two through sixteen, optionally with a parenthesized repeating block such as 0.1(6), rebuilds the exact rational with BigInt arithmetic, then rewrites the value in the target base while mapping remainders so true periods surface as 0. AB(C) instead of a truncated digit dump.

Why fractional base conversion is not integer conversion

Whole-number radix conversion walks place values that grow as powers of the base: ones, base, base squared, and so on. Fractional place values shrink: base to the minus one, minus two, and so on. That single difference breaks every integer-only converter when the user pastes 0.1, 0.

A3, or 0.0011. In base ten, 0.1 is exactly one tenth; in base two the same one tenth is the infinite expansion 0.0(0011), because ten and two share no finite common factor that would terminate both representations. Textbooks introduce this with decimal one third equaling 0.1 in base three and 0.(3) in base ten, but the same identity holds for every pair of bases from two through sixteen.

An integer converter that silently drops the radix point, or that only multiplies by large powers and rounds, invents a different number.

How to write the fraction and read the result

Bases are integers from two to sixteen inclusive. The value field is the fractional part only: write 0. ABC, . ABC, or ABC for a finite expansion in the source alphabet 0–9 and A–F (case-insensitive).

For a known repeating expansion in the source, append a parenthesized block: 0.1(6) means one sixth in base ten when written as 0.1666…, and 0.(3) means pure repeating three. A non-zero integer part is rejected—pair this tool with an integer base converter if you need both halves.

Where converting fractions between bases helps

Computer science classrooms use a fractional base converter so learners can see that 0.1 decimal is not 0.1 binary and can measure period length without hand long-division for every exercise. Compiler and interpreter authors verify literal conversion tables when embedding fractional constants into different radix syntaxes in language specs. Embedded and DSP engineers compare binary and hexadecimal fixed-point patterns against decimal design sheets before they freeze bit widths.

CS homework and radix labs

Convert classroom fractions such as 0.1₁₀ ↔ binary or 0.A₁₆ ↔ decimal and show terminating versus repeating results with period length.

Compiler and language-spec tables

Generate exact fractional digit streams when checking how numeric literals rewrite across bases 2–16 in parsers and test suites.

Fixed-point and DSP design checks

Cross-check decimal design values against binary or hex fractional bit patterns before locking word length and scale factors.

Which bases are supported?

Source and target bases from 2 through 16 inclusive. Digits are 0–9 and A–F as needed for the source base.

How is repeating notation written?

In the input, use a trailing (block) such as 0.1(6) or 0.( 3). In the output, repeating expansions appear as 0.prefix(block) with period set to the block length.

Why does decimal 0.1 never end in binary?

Because one tenth has no finite expansion in base two. The converter rebuilds the exact fraction, finds that the digits 0011 repeat forever and writes 0.0(0011), with a period of 4, instead of a rounded string of bits.

Can I convert a number with a whole part, not just the fraction?

No. Only the part after the point is accepted, and a non-zero whole part is rejected. Convert the whole part with an integer base converter and join the two halves yourself.

How many digits does the result show?

Up to 32 digits after the point by default, and up to 64 if you raise the limit. If a cycle repeats sooner it is closed in parentheses; if the limit comes first, the result says it was cut short.

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/dev/base-fraction-convert

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/dev/base-fraction-convert \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"0.1","from_base":10,"to_base":2}'
{
  "value": "0.1",
  "from_base": 10,
  "to_base": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.base_fraction_convert",
  "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.

A max_digits cap keeps pathological expansions bounded.

Why fractional base conversion is not integer conversion

Designers of fixed-point formats, IEEE-style teaching demos, and assembler constant tables constantly need that rewrite with an honest answer about termination versus period length. This capability never rounds the source: it parses digits into an exact reduced fraction, then emits target digits by the classic remainder map, so terminating, pure-repeating, and mixed-repeating cases all stay faithful until max_digits forces a controlled stop.

Input contract, repeating notation, and response shape

POST a JSON body with value, from_base, and to_base. Optional max_digits (default thirty-two, maximum sixty-four) caps how many target digits are generated before the engine stops; if a remainder repeats earlier, the cycle is closed with parentheses and truncated is false. On success the body echoes a normalized value string, both bases, max_digits, the result string such as 0.0(0011), the non_repeating prefix, optional repeating block, flags is_terminating and is_repeating, the period length, a truncated boolean, a short decimal_approx for human sanity checks, and a formula string. Invalid digits for the source base, bases outside two through sixteen, empty fractions, and malformed parentheses fail with invalid_input and are not billed. Example: value 0.1, from_base ten, to_base two yields a repeating binary fraction for one tenth, not a single rounded bit.

How do I convert a fractional number between two bases?

Send value (e.g. 0.1 or 0.1(6)), from_base and to_base as integers 2–16. The API returns the rewritten fraction with parentheses when a repeating cycle is detected.

What does max_digits control?

It caps how many target fractional digits are emitted (default 32, max 64). True cycles close early via remainder mapping; only non-detected long expansions set truncated true.

What does the fractional base converter cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →