Posit (Unum III) Converter — Decimal ↔ Posit Bit Pattern

Convert a decimal number to a posit (Type III unum) with configurable nbits and exponent bits (es). See the variable-length sign, regime, exponent and fraction fields, the colored bit layout, hex, the decoded value and the rounding error. Presets for Posit(8,0), Posit(16,1) and Posit(32,2). Live in your browser.

Converter Number Systems Updated Jun 21, 2026
How to Use
  1. Pick a preset — Posit(8,0), Posit(16,1) or Posit(32,2) — or set nbits and es (exponent bits) yourself.
  2. Type a decimal number (try 1, 2, 0.5, -1, 3.14, or a very large/small value to see the regime stretch).
  3. Read the colored bit layout: sign, then the variable-length regime run, the exponent (es bits) and whatever fraction bits remain.
  4. Check the decoded value and rounding error, and click any value (or its Copy button) to copy it.
nbits es
Sign Regime Exponent Fraction

What a posit is, and why it has no fixed exponent field

A posit — the Type III unum proposed by John Gustafson — is a binary number format meant as a drop-in rival to IEEE 754 floating point. Where a float splits its bits into a fixed-width exponent and mantissa, a posit is defined by just two numbers: nbits (the total width) and es (how many exponent bits it uses). After a single sign bit comes a variable-length regime, then up to es exponent bits, and whatever is left becomes the fraction. Because the regime grows and shrinks, the format is tapered: numbers near 1.0 spend their bits on fraction precision, while values far from 1.0 spend them on range. The value is reconstructed as (−1)sign × useedk × 2e × (1 + f), with useed = 22es.

Decoding the regime — a run-length, not a field

The trick that confuses everyone the first time is the regime. It is not a fixed-width field; it is a run-length code. Reading the bits after the sign, you count a run of identical bits and stop at the first opposite bit (the “terminating” bit). A run of m ones gives a regime value k = m − 1; a run of m zeros gives k = −m. That terminating bit is consumed by the regime and does not belong to the exponent. Each step of k multiplies the value by useed, an enormous factor (for es = 2, useed = 24 = 16), which is how a short posit can still reach very large and very small magnitudes. Only after the regime do the es exponent bits and the leftover fraction bits get read — so the same nbits gives different field widths for different numbers.

Two special patterns: zero and NaR

Posits keep their exception handling minimal. All bits zero is exactly 0 — and there is only one zero, no separate −0. A 1 followed by all zeros is NaR (“Not a Real”), the single value that stands in for everything IEEE 754 would call ±∞ or NaN. Every other bit pattern is a finite real number, rounded to the nearest representable posit using round-to-nearest, ties-to-even. This converter encodes your decimal to the nearest posit and decodes the result back, showing the exact stored value and the rounding error so you can see where the taper helps and where it costs you precision.

Quick reference

Value
(−1)s × useedk × 2e × (1 + f)
useed
= 22es
Regime (run of 1s)
m ones → k = m − 1
Regime (run of 0s)
m zeros → k = −m
Fields
sign · regime · es exp · fraction
1.0 Posit(8,0)
0x40 = 0100 0000
Zero
all bits 0
NaR
1 then all 0s (0x80 in 8-bit)

About the Posit (Unum III) Converter — Decimal ↔ Posit Bit Pattern

Whether you are at a desk or on your phone, the Posit (Unum III) Converter — Decimal ↔ Posit Bit Pattern makes everyday tasks easy — and it is completely free. Convert a decimal number to a posit (Type III unum) with configurable nbits and exponent bits (es). See the variable-length sign, regime, exponent and fraction fields, the colored bit layout, hex, the decoded value and the rounding error. Presets for Posit(8,0), Posit(16,1) and Posit(32,2). Live in your browser.

How it works

Type a value, then pick what you want to change it into. The answer appears straight away. It all happens on your own device, so it is fast and nothing you type is sent away. Just check that you picked the right “from” and “to” so you get the answer you wanted.

Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.

Frequently Asked Questions

What is a posit?

A posit (Type III unum, designed by John Gustafson) is an alternative to IEEE 754 floating point. Instead of a fixed-width exponent it uses a variable-length “regime” field that adapts to the magnitude of the number: values near 1.0 get more fraction bits (higher precision) while very large or very small values trade precision for range. A posit is defined by two parameters — nbits (total width) and es (the number of exponent bits).

What is the regime, and how is it decoded?

After the sign bit, the regime is a run of identical bits terminated by one opposite bit. If the run is of m ones, the regime value k = m − 1; if it is of m zeros, k = −m. The regime contributes a factor of useed^k to the value, where useed = 2^(2^es). It is a run-length code, not a fixed field, which is why the exponent and fraction widths change as you type.

How is a posit’s value computed?

value = (−1)^sign × useed^k × 2^e × (1 + f), where useed = 2^(2^es), k is the regime value, e is the es-bit exponent, and f is the fraction. Two bit patterns are special: all-zero bits mean exactly 0, and a 1 followed by all zeros means NaR (“Not a Real”), the single posit equivalent of both ±∞ and NaN.

Why no infinity or NaN, just “NaR”?

Posits deliberately have a single exception value called NaR (Not a Real) instead of separate +∞, −∞ and many NaN encodings. There is also only one zero (no −0). This makes the number line a clean projective circle and frees up bit patterns for real values, so a posit of a given width represents slightly more usable numbers than the equivalent IEEE float.

Is anything uploaded?

No. Encoding and decoding (with round-to-nearest-even and BigInt for wide posits) run entirely in your browser with JavaScript — nothing is sent to a server.

How do I use the Posit (Unum III) Converter — Decimal ↔ Posit Bit Pattern?

Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Learning the posit format

See how the regime stretches and the fraction shrinks as a number moves away from 1.0, and watch useed^k · 2^e · (1+f) come together field by field.

Hardware & research

Get the exact hex bit pattern for a posit literal to drop into an FPGA testbench, a softposit reference vector or a paper.

Comparing against IEEE 754

Encode the same value as a posit and as a float to compare rounding error and the precision-vs-range trade-off near 1.0 and at the extremes.

Tapered-precision intuition

Understand why posits give more accuracy around 1 and gracefully lose it toward the very large and very small, instead of overflowing to infinity.

Last updated: