← All Tools ZeroDataUpload Home

BaseShift

6 bases, bitwise operations, ASCII table, text encoding & batch conversion — all with arbitrary-precision BigInt

Launch BaseShift →
BaseShift

Table of Contents

  1. Overview
  2. Key Features
  3. 5 Panels Explained
  4. How to Use
  5. Frequently Asked Questions
  6. Privacy & Security

Overview

BaseShift is a comprehensive number base converter that handles everything from single-value conversions across six number bases to bitwise logic operations, full Unicode text encoding, complete ASCII table browsing, and bulk file conversion — all running as pure client-side JavaScript with zero external libraries. At its core, BaseShift leverages JavaScript’s native BigInt type for arbitrary-precision integer arithmetic, eliminating the 253 precision ceiling that plagues standard Number operations and enabling accurate conversion of integers of any size.

The tool is organized into five purpose-built panels. The Single Converter panel converts between Binary (base 2), Octal (base 8), Decimal (base 10), Hexadecimal (base 16), Base32 (RFC 4648), and Base64 simultaneously — type a value in any base and see all six outputs update in real time. The Text↔Codes panel encodes and decodes text as numeric codes using codePointAt() and String.fromCodePoint(), supporting the full Unicode range including emoji and supplementary plane characters. The Bitwise Operations panel computes AND, OR, XOR, NOT, Left Shift, and Right Shift with an interactive 8-bit visual grid. The ASCII Table panel displays all 256 character codes with search and filtering. The Batch File panel accepts .txt, .csv, and .tsv uploads, auto-detects the source base by sampling content patterns, and converts values in bulk.

Number base systems are the foundation of computing. Every digital device ultimately operates in binary — ones and zeros — but programmers and engineers routinely work in hexadecimal (compact representation of binary data), octal (Unix file permissions), and decimal (human-readable values). Base32 and Base64 encodings extend this further for data serialization, URL-safe tokens, and email attachments. BaseShift unifies all of these conversions into a single interface, augmented by bitwise logic tools that are indispensable for low-level programming, networking, and hardware design.

Key Features

6 Number Bases

Binary, Octal, Decimal, Hex, Base32 (RFC 4648, charset 0-9A-V), and Base64 (A-Za-z0-9+/) — all displayed simultaneously for every input. Prefix auto-stripping for 0b, 0o, and 0x notation.

BigInt Arbitrary Precision

JavaScript BigInt handles numbers of unlimited size: no overflow at 253 (9,007,199,254,740,992), supports negative numbers with sign preservation, and validates characters per base before conversion.

Bitwise Operations

AND, OR, XOR, NOT (8-bit), Left Shift, and Right Shift with results in Decimal, Binary, Hex, and Octal. Interactive 8-bit visual grid renders MSB→LSB positions 7→0 with nibble separator after bit 4.

Complete ASCII Table

All 256 characters (0–255) with Dec, Hex, Oct, Binary, Char, and Description columns. Four filter modes (All, Control, Printable, Extended) and real-time cross-column search.

Text↔Codes

Full Unicode encoding via codePointAt() and String.fromCodePoint(), handling emoji, surrogates, and supplementary plane characters. Output in Binary (8-bit padded), Octal, Decimal, or Hex (2-char padded uppercase).

Batch File Conversion

Upload .txt, .csv, or .tsv files via drag-drop or browse. Auto-detects the source base by sampling the first 20 lines against regex patterns. Converts first column, preserves CSV structure, and downloads the result.

Endian Swap

Reverse byte order for little-endian↔big-endian conversion. Converts to hex, pads to even length, splits into 2-char byte pairs, reverses array, and re-interprets. Essential for cross-platform binary data work.

Smart Formatting

Digit grouping (4-bit binary, 3-digit decimal with commas, 4-digit hex), signed 32-bit integer display with overflow detection, Unicode character output for valid codepoints, and scientific notation for extreme values.

5 Panels Explained

Panel 1: Single Converter — 6 Bases Simultaneously

The Single Converter is the default panel and the heart of BaseShift. It presents six base selector buttons — BIN, OCT, DEC, HEX, B32, B64 — and a single input field. Select your source base, type or paste a value, and all six output fields update instantly. This simultaneous conversion eliminates the need to run separate tools for binary-to-hex, decimal-to-octal, or any other combination.

Under the hood, all arithmetic uses JavaScript’s BigInt type. The parseToBigInt() function processes the input string left-to-right using multiplication accumulation: for each digit, the running result is multiplied by the base and the digit’s value is added (result = result * base + digit). For Base32 and Base64, which use custom character sets, the parseBaseN() function performs index-based lookup against the RFC 4648 charset (0-9A-V for Base32, A-Za-z0-9+/ for Base64). This approach works for integers of any size, unlike parseInt() or Number() which silently lose precision beyond 253.

Negative numbers are fully supported: the sign prefix is parsed and preserved through all conversions, so entering -FF in hex correctly produces -255 in decimal and -11111111 in binary. Input cleaning strips whitespace, underscores, and commas via the regex /[\s_,]/g, allowing users to paste formatted values like 1,000,000 or 1111_0000 without errors. Prefix notation (0b for binary, 0o for octal, 0x for hex) is automatically detected and stripped before parsing.

The panel also provides a signed 32-bit integer display. The BigInt value is masked with 0xFFFFFFFFn to extract the lower 32 bits, then JavaScript’s bitwise OR with 0 ((u32 | 0)) reinterprets the result as a signed 32-bit integer, matching how C, Java, and other languages handle int32. If the input value exceeds 32 bits, the display shows “Overflow (>32-bit)” as a warning. Additionally, if the numeric value is at or below U+10FFFF (the maximum Unicode codepoint), the panel shows the corresponding character and its codepoint notation; non-printable characters display the codepoint only.

The Group Digits toggle activates the groupString() function, which inserts separators right-to-left: 4-bit groups for binary (e.g., 1010 0011), 3-digit groups for octal and decimal (e.g., 16,777,215), and 4-digit groups for hexadecimal (e.g., 00FF FFFF). This makes large values dramatically easier to read and verify at a glance.

Panel 2: Text↔Codes — Full Unicode Encoding

The Text↔Codes panel converts between human-readable text and numeric character codes. The encodeText() function iterates through each character using codePointAt(0) — critically, this handles the full Unicode range including supplementary plane characters (emoji, CJK extensions, mathematical symbols) that occupy two JavaScript UTF-16 code units (surrogate pairs). Using codePointAt() instead of charCodeAt() is essential because charCodeAt() would split emoji and other characters above U+FFFF into two meaningless surrogate values.

The encoded output is formatted in the user’s selected base: Binary produces 8-bit zero-padded codes (e.g., the letter “A” becomes 01000001), Octal produces standard octal values, Decimal produces plain numeric codes, and Hexadecimal produces uppercase 2-character padded values (e.g., 41 for “A”). Each character’s code is space-separated in the output for readability.

Decoding works in reverse: the decodeText() function parses a string of space-separated or comma-separated numeric codes, converts each to an integer in the selected base, and reconstructs the original text using String.fromCodePoint(). This function correctly reassembles supplementary plane characters from their codepoint values. A swap button calls decodeText() to instantly reverse the direction, making it easy to verify round-trip encoding integrity.

Panel 3: Bitwise Operations — Logic with Visual Feedback

The Bitwise Operations panel provides a calculator for the six fundamental bitwise operations used in low-level programming, networking, and hardware design. Two input fields accept values A and B, with the parseSafe() function auto-detecting the input format: plain numbers are treated as decimal, 0x-prefixed values as hexadecimal, 0b-prefixed as binary, and 0o-prefixed as octal.

The six operations are:

Each result is displayed in four representations: Decimal, Binary, Hexadecimal, and Octal. Below the numeric results, the renderBits() function generates an 8-bit visual grid showing the binary state of the result. The grid displays positions from MSB (bit 7) to LSB (bit 0), with a visual nibble separator between bit 4 and bit 3. Active bits (value 1) receive a blue .on CSS class, while inactive bits (value 0) receive a muted .off class. This visualization makes it immediately obvious which bits are set, which is invaluable when debugging bitmasks, network subnet calculations, or register values.

For reference, the fundamental bitwise truth tables are:

Panel 4: ASCII Table — 256 Characters with Search & Filter

The ASCII Table panel presents all 256 character codes (0–255) in a comprehensive, searchable table with six columns: Decimal, Hexadecimal, Octal, Binary, Character, and Description. This is a complete reference that covers the original 7-bit ASCII standard and the extended 8-bit range.

The table is organized into logical ranges:

Four filter modes let you narrow the table: “All” shows all 256 entries, “Control” shows only codes 0–31 plus 127, “Printable” shows codes 32–126, and “Extended” shows codes 128–255. A real-time search field filters across all columns simultaneously — type a decimal number, hex value, character, or partial description and matching rows appear instantly.

Historical context: ASCII (American Standard Code for Information Interchange) was published in 1963 as ANSI X3.4, developed with significant input from Bell Labs engineers. It established a 7-bit encoding scheme (128 characters) that became the universal foundation for digital text. The 8th bit was originally reserved as a parity bit for error detection during transmission. When the industry moved to 8-bit bytes, the upper 128 codes were used for extended characters, but different manufacturers and regions created incompatible extensions (ISO 8859-1, Windows-1252, Mac Roman, etc.), leading to the “mojibake” problem of garbled text across systems. This fragmentation was ultimately resolved by Unicode, which subsumed ASCII as its first 128 codepoints while extending to over 149,000 characters across 161 scripts.

Panel 5: Batch File Conversion — Bulk Processing with Auto-Detection

The Batch File panel handles bulk conversion of numeric data in files. Users upload a .txt, .csv, or .tsv file via drag-and-drop or the file browse dialog. The panel supports four bases for batch operations: Binary, Octal, Decimal, and Hexadecimal (Base32 and Base64 are excluded from batch mode due to ambiguity in line-by-line detection).

The auto-detection engine samples the first 20 non-empty lines of the file and tests each against a series of regex patterns in order: /^[01]+$/ for binary, /^[0-7]+$/ for octal, /^-?\d+$/ for decimal, and /^[0-9a-f]+$/i for hexadecimal. The detection favors the most restrictive match — a line containing only 0s and 1s is classified as binary even though it could also be valid decimal. This heuristic works reliably for typical data files.

For CSV files, the converter intelligently processes only the first column of each row while preserving all remaining columns unchanged. This allows users to convert numeric identifiers or values in structured data without destroying the surrounding context. Each converted line replaces the original first-column value with its equivalent in the target base.

Error handling is built into every line: if a value fails to parse (invalid characters for the detected base, empty fields, or malformed data), the original line is preserved with a /* ERROR */ comment appended, ensuring that the output file always has the same number of lines as the input. The converted file is downloaded as converted_base{N}.txt where N is the target base number.

A file preview displays the first 2,000 characters of the uploaded file with a “(truncated)” indicator if the file exceeds that length, giving users a quick visual confirmation of what they uploaded before initiating conversion.

Endian Swap — Byte Order Reversal

Endianness refers to the order in which bytes of a multi-byte value are stored in memory. Big-endian (also called network byte order or Motorola byte order) stores the most significant byte first: the value 0x12345678 is stored as bytes 12 34 56 78. Little-endian (Intel x86 byte order) stores the least significant byte first: the same value is stored as 78 56 34 12. The terminology comes from Danny Cohen’s 1980 paper “On Holy Wars and a Plea for Peace” (IEN 137), which borrowed from Jonathan Swift’s Gulliver’s Travels where factions warred over which end of an egg to crack.

The swapEndian() function works in four steps: first, it converts the numeric value to its hexadecimal string representation; second, it pads the hex string to an even length (ensuring complete byte pairs); third, it splits the string into 2-character byte pairs; fourth, it reverses the array of byte pairs and re-joins them for reinterpretation. This operation is essential when working with binary file formats, network protocols, embedded systems firmware, or any scenario where data crosses between architectures with different endianness.

Number Formatting — Intelligent Display

BaseShift applies context-sensitive formatting to make numeric outputs as readable as possible. Very large values (≥1015) or very small values (<10-6) are displayed in scientific notation with 6 decimal places. Large values (≥106) use precision formatting with locale-aware comma grouping. Normal-range values display 8–10 significant figures. Division by zero edge cases display the infinity symbol (∞). The groupString() function handles base-specific grouping: binary digits are grouped in fours, octal and decimal digits in threes, and hexadecimal digits in fours, with separators inserted right-to-left from the least significant digit.

BigInt vs. Number: Why Precision Matters

JavaScript’s standard Number type uses IEEE 754 double-precision floating-point representation, which provides 53 bits of integer precision. This means any integer larger than 253 (9,007,199,254,740,992) cannot be represented exactly — operations silently round to the nearest representable value. For example, Number(9007199254740993) evaluates to 9007199254740992, silently losing the last digit. In a number base converter, this kind of silent precision loss would produce incorrect results for large values — cryptographic keys, blockchain addresses, 64-bit identifiers, and large binary masks would all convert incorrectly.

BigInt, introduced in ES2020, represents integers with arbitrary precision. There is no upper limit on the number of digits, and arithmetic operations (+, -, *, /, %, **) produce exact results regardless of magnitude. BaseShift uses BigInt throughout its conversion pipeline, from parsing input strings to computing intermediate results to formatting output strings. The parseToBigInt() function processes each digit of the input left-to-right, accumulating the result with result = result * BigInt(base) + BigInt(digitValue), ensuring that no precision is lost at any stage. This makes BaseShift suitable for converting values of any size — 128-bit UUIDs, 256-bit cryptographic hashes, 512-bit keys, or even larger numbers are all handled accurately.

How to Use

  1. Open BaseShift — The Single Converter panel is active by default, presenting six base selector buttons (BIN, OCT, DEC, HEX, B32, B64) and a text input field. No installation, login, or setup is needed.
  2. Select a Base and Enter a Number — Click one of the base buttons to set your input base, then type or paste a number. All other five base outputs update instantly. You can use prefix notation (0b, 0o, 0x) and the base will be auto-detected. Input with commas, underscores, or spaces is automatically cleaned.
  3. Enable Digit Grouping — Toggle the “Group Digits” option for readable formatting: 4-bit groups in binary (1010 0011), comma-separated thousands in decimal (16,777,215), and 4-digit groups in hex (00FF FFFF). This makes large values much easier to read and verify.
  4. Use the Bitwise Tab — Switch to the Bitwise Operations panel and enter values A and B (in decimal, hex, binary, or octal using prefix notation). Select an operation (AND, OR, XOR, NOT, SHL, SHR) and see results in all four bases plus the 8-bit visual grid showing exactly which bits are set.
  5. Encode or Decode Text — Switch to the Text↔Codes panel. Type text in the input field to encode it as numeric codes in your chosen base (Binary, Octal, Decimal, or Hex). Paste numeric codes in the output field and click Swap to decode back to text. Full Unicode support means emoji and international characters work correctly.
  6. Browse the ASCII Table — Switch to the ASCII Table panel to view all 256 characters. Use the filter buttons (All, Control, Printable, Extended) to narrow the view, and type in the search box to find characters by decimal value, hex code, character, or description.
  7. Upload a File for Batch Conversion — Switch to the Batch File panel, then drag-and-drop or browse to upload a .txt, .csv, or .tsv file. BaseShift auto-detects the source base from the content, lets you choose the target base, and downloads the converted file with CSV structure preserved.

Frequently Asked Questions

What number bases are supported?
The Single Converter panel supports six bases: Binary (base 2), Octal (base 8), Decimal (base 10), Hexadecimal (base 16), Base32 (RFC 4648, charset 0-9A-V), and Base64 (charset A-Za-z0-9+/). All six outputs are displayed simultaneously for every input. The Batch File panel supports four of these — Binary, Octal, Decimal, and Hexadecimal — because Base32 and Base64 cannot be reliably auto-detected from file content on a line-by-line basis.
What is BigInt and why does it matter?
JavaScript’s standard Number type uses 64-bit floating-point representation, which can only represent integers exactly up to 253 (9,007,199,254,740,992). Beyond that threshold, values are silently rounded — 9007199254740993 becomes 9007199254740992. BigInt is a newer JavaScript type (ES2020) that represents integers with arbitrary precision: there is no upper limit, and all arithmetic is exact. BaseShift uses BigInt for all conversions, which means it correctly handles 64-bit identifiers, 128-bit UUIDs, 256-bit cryptographic hashes, and numbers of any size without overflow or precision loss.
How does the 8-bit visualization work?
The renderBits() function creates a grid of 8 cells representing bit positions from MSB (bit 7, leftmost) to LSB (bit 0, rightmost). A visual nibble separator appears between bit 4 and bit 3, dividing the byte into its upper and lower nibbles. Each cell receives either a blue .on class (bit value 1) or a muted .off class (bit value 0). This makes it immediately clear which bits are set in any bitwise operation result — especially useful when working with bitmasks, flags, or subnet calculations.
What does NOT do in 8-bit mode?
The NOT operation inverts every bit: 0 becomes 1 and 1 becomes 0. In BaseShift, NOT is constrained to 8 bits using the mask ~a & 0xFF. So NOT of 00000101 (decimal 5) produces 11111010 (decimal 250), not the 32-bit or 64-bit inversion that JavaScript’s raw ~ operator would produce. This 8-bit constraint matches the visual grid and is the most common use case for bitwise NOT in embedded and hardware contexts.
What is endian swap for?
Endian swap converts between little-endian and big-endian byte order. Little-endian (used by Intel x86 and ARM processors) stores the least significant byte first in memory. Big-endian (used in network protocols, Motorola 68k, and many file formats) stores the most significant byte first. When you read binary data from a file or network packet on a system with different endianness, the bytes are in the wrong order and the value is misinterpreted. The endian swap function reverses the byte order to correct this. For example, hex value 0x12345678 becomes 0x78563412 after swapping.
Can I search the ASCII table?
Yes. The search field performs real-time filtering across all six columns: decimal value, hexadecimal code, octal code, binary representation, the character itself, and its description. For example, searching “at sign” highlights the @ character (decimal 64), searching “127” finds DEL, and searching “exclamation” finds the ! character. The four filter mode buttons (All, Control, Printable, Extended) can be combined with search for even more precise lookup.
How does batch auto-detection work?
The auto-detection engine reads the first 20 non-empty lines from the uploaded file and tests each line against regex patterns in order of specificity: /^[01]+$/ (binary — only 0s and 1s), /^[0-7]+$/ (octal — only digits 0-7), /^-?\d+$/ (decimal — digits 0-9 with optional negative sign), and /^[0-9a-f]+$/i (hexadecimal — digits and letters a-f). The most restrictive matching pattern wins. For CSV and TSV files, only the first column is tested. This heuristic is reliable for typical data files but can be overridden if the auto-detected base is incorrect.
Does it handle negative numbers?
Yes. Negative numbers are fully supported in the Single Converter. When a negative value is entered (e.g., -FF in hex or -255 in decimal), the sign prefix is parsed separately, the magnitude is converted via BigInt, and the sign is preserved in all output bases. So -255 in decimal correctly produces -FF in hex, -11111111 in binary, and -377 in octal. The signed 32-bit display also correctly shows two’s complement interpretation for negative values.
What is the signed 32-bit display?
The signed 32-bit display interprets the current value as a 32-bit signed integer, matching the int type in C, Java, C#, and most programming languages. It works by masking the BigInt value with 0xFFFFFFFFn to extract the lower 32 bits, then applying JavaScript’s bitwise OR with 0 (u32 | 0) which triggers sign extension — values with bit 31 set become negative. For example, 0xFFFFFFFF displays as -1 in signed 32-bit. If the input value requires more than 32 bits to represent, the display shows “Overflow (>32-bit)” to alert you that the 32-bit interpretation is truncated.
Is my data safe?
Absolutely. All math runs as pure JavaScript BigInt and parseInt/toString operations directly in your browser’s JavaScript engine. BaseShift loads zero external libraries — no math libraries, no encoding libraries, no network requests. There are no API calls, no server-side processing, and no data transmission of any kind. Numbers you convert, text you encode, files you upload for batch processing, and ASCII lookups you perform are all processed entirely on your device. Nothing ever leaves your browser.

Privacy & Security

Your Data Never Leaves Your Device

BaseShift uses pure JavaScript mathematical operations — BigInt for arbitrary-precision integer arithmetic, parseInt() and toString() for base conversion, and native bitwise operators (&, |, ^, ~, <<, >>) for logic operations. No external libraries are loaded, no APIs are called, and no data is transmitted. Your numbers, text, calculations, ASCII lookups, and uploaded files for batch conversion are processed entirely in your browser’s JavaScript engine. The conversion algorithms are implemented from first principles using BigInt multiplication accumulation and index-based charset lookup — there is nothing between your data and the math except pure JavaScript.

Ready to try BaseShift? It's free, private, and runs entirely in your browser.

Launch BaseShift →

Related

Milan Salvi

Milan Salvi

Founder, Leena Software Solutions

Milan is the founder of ZeroDataUpload and Leena Software Solutions, building privacy-first browser tools that process everything client-side. View all articles · About the author.

Last Updated: March 26, 2026