Posit Converter
Convert numbers to and from posits, the alternative to IEEE floats. See the sign, regime, exponent and fraction fields of any posit⟨n, es⟩, rounded exactly as the 2022 posit standard defines.
How to Use
- Choose number to posit or posit to number.
- Set the size n (8, 16, 32 or 64 bits are standard) and es, the number of exponent bits; the 2022 standard uses es = 2 for every size.
- Type a number such as 3.14159, or a pattern in hex or binary.
- Read the bits, the hex, the value and the error; the drawing colours the regime, exponent and fraction.
- Show Work decodes the regime run and builds the value step by step.
Worked Example
π as a 32-bit posit (es = 2). π = 1.5708 × 2¹, so the scale is 1. With es = 2, each regime step is 2⁴ = 16, so k = ⌊1 ÷ 4⌋ = 0 and e = 1. A k of 0 is written as the run “1” plus a terminating 0, the regime 10; e = 1 in two bits is 01. That leaves 32 − 1 − 2 − 2 = 27 bits for the fraction of π ÷ 2 = 1.1001001000011111101101010…₂. The next bit is 0, so no rounding up: 0 10 01 100100100001111110110101010 = 0x4C90FDAA.
Reading posit16 0xC000. The sign bit is 1, so take the two’s complement: 0x4000 = 0 10 00 00000000000. Regime 10 gives k = 0, exponent 00 gives e = 0, fraction 0, so the magnitude is 1 and the value is −1.
The common mistake: reading a negative posit directly. Unlike a float, a negative posit is not a sign bit in front of the positive pattern: the whole word is two’s-complemented. Reading 0xC000 as sign 1 plus 100 0000 0000 0000 would give a regime of 1 and the wrong answer.
Show Work
Formulas
From Unums to Posits
John Gustafson proposed universal numbers, or unums, in his 2015 book The End of Error; the first two types had variable size and were hard to build in hardware. Posits, unums of type III, came in 2017 with Isaac Yonemoto: fixed size, a single zero, a single exception value, and a regime field that gives “tapered” precision, highest near 1 where most values in practice fall.
The Posit Working Group published a standard in 2022 that fixed es at 2 for every size, so posit8, posit16, posit32 and posit64 share the same structure. Posits remain an active research area, with open-source libraries such as SoftPosit and experimental processors, but IEEE 754 floats are still what mainstream hardware computes with.
About This Calculator
This converter encodes numbers as posits of any size from 4 to 64 bits with 0 to 4 exponent bits, and decodes posit bit patterns, including negative values, zero and NaR. Encoding is exact: the full bit string is built with whole-number arithmetic and rounded to nearest, ties to even, saturating at maxpos and minpos. It shows the bits with the regime, exponent and fraction coloured, the value and the rounding error.
Everything runs in your browser; nothing is sent anywhere. To compare with an IEEE float of the same size, use the IEEE 754 converter.
Related calculators: IEEE 754 Float Converter, Minifloat Converter, and FP16 and bfloat16 Converter.
Frequently Asked Questions
What is a posit?
A posit is a floating-point format proposed by John Gustafson in 2017 as a replacement for IEEE 754 floats. Instead of a fixed-size exponent it has a variable-length regime: a run of identical bits that sets a coarse power. Numbers near 1 get short regimes and therefore more fraction bits, so posits are more accurate than floats of the same size near 1 and less accurate at the extremes.
How do I decode a posit?
Skip the sign bit (for a negative posit, take the two’s complement of the whole pattern first). Count the run of identical bits that follows: m ones give k = m − 1, m zeros give k = −m. The next es bits are the exponent e, and the rest is the fraction f. The value is 2^(k × 2^es + e) × 1.f.
What are maxpos and minpos?
The largest and smallest positive posits: maxpos = 2^((n − 2) × 2^es) and minpos is its reciprocal. For a standard posit8 (es = 2) that is 2²⁴ ≈ 16.8 million; for posit32 it is 2¹²⁰ ≈ 1.3 × 10³⁶. Results never overflow to infinity or underflow to zero: they saturate at maxpos and minpos.
Does a posit have NaN or infinity?
It has one exceptional value, NaR (not a real), the pattern 1000…0, used for results such as 0 ÷ 0 or √−1. There is one zero (all bits 0), no negative zero, and no infinities, so every other one of the 2ⁿ patterns is a distinct real number.
Are posits better than floats?
For values near 1 a 32-bit posit has up to 27 fraction bits against a float’s 23, which helps in machine learning and signal processing. But precision falls away at very large and very small values, and posits are not supported by mainstream CPUs; they are used mainly in research hardware and software libraries.
How do I use the Posit Converter?
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
posit32
π is 0x4C90FDAA: regime 10, exponent 01 and 27 fraction bits.
posit8
With es = 2, maxpos is 2²⁴ = 16,777,216 and 1.0 is 0x40.
Saturation
10¹⁰ in posit8 saturates to maxpos instead of overflowing.
Legacy formats
posit⟨8, 0⟩, from the 2017 paper, has maxpos 64 and minpos 1/64.
Last updated: