Number Base Converter
Binary, octal, decimal, hex and float bits
Convert numbers between bases, see two's complement and IEEE-754 float bits, and run bitwise operations.
- Binary
- Hex
- Bitwise
- IEEE-754
How to use Number Base Converter
- Type an integer into Number, or press Try an example. With Input base on Auto,
0x,0band0oprefixes pick hex, binary or octal and anything else is decimal. Choose Bin, Oct, Dec, Hex or Other (bases 2–36) to force a base. - Read the value in binary, octal, decimal and hex, plus any base from 2 to 36 in the As row. Group digits and Uppercase change how the output is written.
- Check Two’s complement for the 8, 16, 32 and 64-bit signed and unsigned forms, and whether the number fits each width.
- Under IEEE-754 floating point, enter a decimal value (or
inf,NaN) or switch Float input to Hex bits to decode raw bits, and pick float32 or float64 to see the sign, exponent, mantissa and exact stored value. - Use the Bitwise calculator to combine A and B with AND, OR, XOR, NAND, NOR, NOT, shifts and rotations at a chosen Width, and Characters and codes to turn text into code points and UTF-8 bytes or codes back into text.
How it works
Integers are parsed digit by digit into JavaScript BigInt, so there is no size limit and large values are never rounded. Spaces, underscores, commas and apostrophes are ignored as group separators, a leading + or - sets the sign, and in Hex mode a leading # is also accepted. Invalid digits are reported with their position.
Two’s complement uses BigInt.asIntN and BigInt.asUintN to wrap the value to each width. A number “fits” if it is within the signed minimum and the unsigned maximum of that width. The bitwise calculator wraps both operands to the selected width the same way, so the result is always shown as both unsigned and signed.
Float bits are read and written with a DataView, exactly as the computer stores them. The stored value is expanded to its full exact decimal, which shows, for example, that 0.1 is really 0.1000000000000000055511151231257827021181583404541015625 in float64. Characters are read as Unicode code points and encoded with TextEncoder for the UTF-8 bytes.
Limits
- Only integers are converted between bases; fractions aren’t supported there. Use the IEEE-754 section for fractional values.
- Two’s complement is shown for 8, 16, 32 and 64 bits. The bitwise calculator offers 8, 16, 32, 64 and 128 bits, and shift and rotate amounts must be between 0 and 100,000.
- In Hex bits mode the value must fit the chosen width: up to 8 hex digits for float32 and 16 for float64.
- Text → codes lists the first 500 characters. Codes → text accepts decimal,
0x…or…hhex,U+…,\u…and0b…, separated by spaces, commas or semicolons; values outside 0–0x10FFFF and lone surrogates are rejected.
Privacy
Everything runs in your browser with built-in JavaScript. Nothing you enter is uploaded or saved. Copy share link puts your inputs and settings from every section in the link’s # fragment, which browsers don’t send to servers, so anyone you give the link to can see them.
Frequently asked questions
Is there a limit on how big a number can be?
No fixed limit. Numbers are handled as arbitrary-precision integers (BigInt), so a 100-digit decimal converts exactly. Very long inputs just take longer to display.
How do I enter a negative number in hex or binary?
Put a minus sign in front, for example -0xff. The conversions show it with a minus sign, and the two’s complement section shows the bit pattern a computer would store, such as 0xFF01 for 16 bits.
Why is 0.1 not exactly 0.1?
Binary floating point can’t represent most decimal fractions exactly, so the nearest representable value is stored. The Stored value row shows that value in full.
What does “overflows, wrapped” mean?
The number doesn’t fit in that many bits, signed or unsigned. The bits shown are the lowest ones, which is what a fixed-width integer would keep after overflowing.
What is the difference between >>> and >>?
A >>> B (logical) shifts in zeros from the left. A >> B (arithmetic) copies the sign bit, so negative numbers stay negative. Both work within the selected Width.
More tools
- Clean Image: Inspect and remove hidden image metadata
- JWT Decoder: Decode and verify JSON Web Tokens
- Diff Checker: Compare two texts line by line
- JS Runner: Run JavaScript and TypeScript in your browser
- JSON Formatter: Format, validate and minify JSON
- Encode / Decode: Base64, URL, HTML entity and hex
- Hash Generator: MD5, SHA and HMAC of any text
- UUID Generator: Generate UUID v4 and v7 in bulk
- Timestamp Converter: Unix time ↔ human dates
- Regex Tester: Test regular expressions live
- URL Parser: Break a URL into its parts
- HTTP Status Codes: Look up any HTTP status code
- MIME Type Lookup: File extension ↔ MIME type
- Password Generator: Strong random passwords and passphrases
- Random String Generator: Random tokens, IDs and keys
- Slug Generator: Turn titles into URL slugs
- Case Converter: camelCase, snake_case, Title Case and more
- Word Counter: Count words, characters and reading time
- JSON to TypeScript: Generate TypeScript types from JSON
- JSON Diff: Compare two JSON documents structurally
- JSON to SQL: Turn JSON arrays into SQL inserts
- YAML ↔ JSON: Convert between YAML and JSON
- XML ↔ JSON: Convert between XML and JSON
- CSV ↔ JSON: Convert between CSV and JSON
- CSV Viewer: View, sort and filter CSV files
- SQL Formatter: Format and beautify SQL queries
- cURL ↔ Fetch: Convert cURL commands to fetch and back
- Markdown Editor: Write Markdown with a live preview
- Text Cleaner: Remove duplicate lines, empty lines and extra spaces
- Find & Replace: Find and replace in any text
- Cron Expression Builder: Build and explain cron schedules
- User-Agent Parser: Identify browser, OS and device from a user agent
- HTTP Headers Inspector: Paste response headers and get them explained
- JWT Generator: Create and sign test JSON Web Tokens
- Certificate Inspector: Decode PEM certificates and keys
- Meta Tag Inspector: Check a page's SEO and social tags
- UTM Builder: Build campaign URLs with UTM parameters
- URL Cleaner: Strip tracking parameters from links
- Robots.txt Generator: Create and test a robots.txt file
- Sitemap Generator: Create an XML sitemap from a list of URLs
- Image Compressor: Shrink JPEG, WebP and AVIF images in your browser
- Image Resizer: Resize images by pixels, percentage or to fit a box
- Image Converter: Convert between PNG, JPEG, WebP and AVIF
- Image to Base64: Encode images as Base64 data URIs and decode them back
- SVG Optimizer: Minify and sanitize SVG files
- Favicon Generator: Make favicon.ico, Apple and Android icons from an image or emoji
- Color Converter: HEX, RGB, HSL, OKLCH and contrast checks
- IP / CIDR Calculator: Subnets, masks and IP ranges for IPv4 and IPv6
- JSONPath Query: Query JSON with JSONPath expressions
- JSON Schema Validator: Validate JSON against a schema, or generate one
- Semver Checker: Check versions against semver ranges
- chmod Calculator: Unix permissions: rwx ↔ octal
- .env Diff: Compare and validate .env files
- TOTP Generator: Generate and verify 2FA codes
- String Escaper: Escape and unescape strings for any language
- Unicode Inspector: See every character, code point and hidden symbol
- Mock Data Generator: Generate realistic fake data
- QR Code Generator: Create QR codes for links, Wi-Fi and contacts
- Lorem Ipsum Generator: Placeholder text in paragraphs, sentences or words
- Date Calculator: Date differences, business days and durations
- Unit Converter: Convert bytes, lengths, weights, temperatures and more
- Query CSV with SQL: Run SQL queries on CSV files
- PDF Merge & Split: Merge, split, reorder and rotate PDFs
- PDF Metadata Cleaner: See and remove hidden PDF metadata
- Office Metadata Cleaner: Remove author and revision data from Word, Excel and PowerPoint
- Images to PDF: Combine images into one PDF
- Image Editor: Crop, rotate, resize and adjust images
- Encrypt / Decrypt Text: Encrypt text with a passphrase (AES-GCM)
- SSH Key Generator: Generate Ed25519 and RSA SSH keys locally
- Email Header Analyzer: Trace an email's path and check SPF, DKIM and DMARC
- JSON to Code: Generate Go, Python, Rust, Java, C# and Kotlin models from JSON
- docker run ↔ Compose: Convert docker run commands to docker-compose and back
- Color Palette Extractor: Pull the dominant colours out of any image
- Password Strength Checker: How long would your password take to crack?
- SPF / DKIM / DMARC Checker: Validate and explain email DNS records
- Kubernetes YAML Checker: Validate and explain Kubernetes manifests
- .gitignore Generator: Build a .gitignore from presets
- CSP Builder: Build and check a Content-Security-Policy
- JSON-LD Generator: Create schema.org structured data
- Open Graph Image Generator: Make 1200×630 social preview images
- CSS Generator: Gradients, shadows, clamp() and more
- Time Zone Meeting Planner: Find meeting times across time zones