Two's Complement Explained: 8-Bit Examples
Two’s complement is how processors store signed integers: a fixed-width bit pattern whose leftmost bit weighs −2n−1. In 8 bits that weight is −128, the range is −128 to 127, and −5 is 11111011. FlashKit’s two’s complement calculator converts decimal to those bits and back, shows one’s complement, and prints invert+1. Negatives with the remainder table live on decimal to binary for signed integers. The all-bases binary converter uses the same invert+1 math on its Number tab, plus fractions and UTF-8 text.
8-bit table (−128, −5, −1, 0, 127)
| Decimal | Two’s complement | One’s complement of the magnitude | Unsigned readout |
|---|---|---|---|
| 0 | 00000000 | 11111111 | 0 |
| 127 | 01111111 | 10000000 | 127 |
| −1 | 11111111 | 11111110 | 255 |
| −5 | 11111011 | 11111010 | 251 |
| −128 | 10000000 | 01111111 | 128 |
128 decimal does not fit (max 127). −129 does not fit (min −128). FlashKit reports the range instead of wrapping. These rows were checked with the same BigInt invert+1 helper the calculator uses: pad, invert, add 1.
Convert −5 at 8 bits
Pick 8-bit, type −5, read 11111011. Switch to bits → decimal and paste 10000000 for −128.
Open the two’s complement calculatorInvert bits, then add 1
Take −5. The magnitude 5 in 8 bits is 00000101. Invert every bit (one’s complement): 11111010. Add 1: 11111011. That is the stored pattern. Positive 5 skips invert+1 and stays 00000101. Zero is all zeros. −1 is all ones at every width because invert(000…001) + 1 fills the word with 1s.
Reading the other way uses place values with a negative sign bit. 11111011 = −128 + 64 + 32 + 16 + 8 + 0 + 2 + 1 = −5. 10000000 = −128. 01111111 has a 0 sign bit, so 64+32+16+8+4+2+1 = 127. Short pastes are zero-padded on the left: 1011 in 8 bits is +11, not −5. Type 11111011 when you mean −5.
4-bit worksheets follow the same rule with range −8 to 7: 1000 is −8, 0111 is 7, 1111 is −1. Adding two patterns belongs on the binary calculator with steps in signed mode — 11111011 + 00000011 in 8-bit signed is −5 + 3 = −2, stored as 11111110.
Same invert+1 on the number converter
Signed mode, width 8, type −5. Fractions such as 10.625 stay on that page, not on the dedicated calculator.
Open the decimal to binary converterOverflow is a range error, not wrap
Hardware often wraps: 127 + 1 becomes −128 in 8-bit two’s complement. FlashKit does not wrap on these pages. 128 or −129 at 8 bits is a red alert. 64-bit min is −9223372036854775808 (a 1 followed by 63 zeros). JavaScript Number is exact only up to 253−1, so many 64-bit values lose precision, which is why the calculator uses BigInt.
What this guide is actually for
Learn two’s complement with 8-bit tables: −1, −5, −128 and 127. Invert+1 steps and a calculator that shows the range. This article is a knowledge-base companion, not a doorway page and not a substitute for the interactive tool. FlashKit prerenders the full HTML at build time so you can read it without waiting for a client bundle. Claims below match the code: local tools stay in the tab; network tools disclose proxies or APIs before they send a URL or photo.
If a third-party roundup promised a FlashKit URL that 404s (PDF-to-Word, HTML-to-Markdown, HTML/CSS/JS minifiers, social downloaders), that product is not in the catalog. Use the live tools linked here instead of hunting retired slugs.
Tools that pair with this topic
Open the matching utility when you want to try the steps, then come back to this page for the why. Related tools for Two's Complement Explained: 8-Bit Examples:
- Two's Complement Calculator — Convert decimal to two's complement binary and back at 4, 8, 16, 32 or 64 bits.
- Binary Translator — Convert text to binary code and binary to text.
- Decimal to Binary Converter — Convert decimal to binary with repeated ÷2, fractions, and two’s complement steps.
- Binary Calculator — Add, subtract, multiply and divide binary numbers with step-by-step working.
Start with the Two's Complement Calculator. Read the on-page how-to and FAQ there — they describe the same browser session this guide refers to, including whether a file is uploaded.
A practical workflow
- Decide whether the job is local (PDF, image, password, encoding, India tax math) or needs a public URL fetch (SEO audit, Open Graph, WHOIS). Do not paste secrets into fetch tools.
- Use the matching FlashKit page linked above. Consent checkboxes on network tools are required before the request leaves the browser.
- Copy or download the result from this tab. FlashKit does not keep a locker or an account.
- Verify the output: validate HTML, preview OG tags, open a PDF, or count characters for a caption limit — whatever the job actually needs.
- If you came from a locale URL, the canonical English guide is the one search engines should index for this topic, except selected Hindi translations.
Honest limits
FlashKit is a free Vite/React tools site. It is not a bank, GSTN portal, SEBI adviser, PDF-to-Word OCR engine, social downloader, or cloud CDN. Finance calculators are arithmetic. SEO audits use public CORS proxies and are not Search Console. AdSense and GA4 load in the document head; see the privacy policy for cookies, and the terms of use for acceptable use. Contact: support@flashkit.tools.
YouTube thumbnail, Instagram, TikTok, Facebook, and X/Twitter downloaders are not offered; those URLs 301 to a live tool. Mute a file you already have.
Related reading on FlashKit
- Convert Text to Binary (Unicode) — How FlashKit’s binary converter turns letters into space-separated Unicode binary tokens — and why that is not UTF-8, hex, or a firmware dump.
- What Is Punycode? IDN to ASCII (xn--) — Why internationalized domain names show up as xn-- labels, how to convert IDN to ASCII in the browser, and how to spot lookalike characters.
- Text to Hex: How ASCII and UTF-8 Hex Encoding Works — Convert text to hexadecimal by hand and online. Worked examples show why "Hi" is 48 69 but ₹ becomes E2 82 B9 in UTF-8, plus spacing and 0x formats.
- How to Read Binary Code: Letters to Text, Step by Step — Read binary code by hand: split into 8-bit bytes, add place values, map to ASCII. Worked examples decode Hi and FlashKit, then check with a translator.
The knowledge base index lists every English guide. Category hubs (SEO, Media, Finance, and the rest) list the live tools. None of this copy invents user counts, SLAs, or features the code does not ship.