Two's Complement Explained: 8-Bit Examples

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)

DecimalTwo’s complementOne’s complement of the magnitudeUnsigned readout
000000000111111110
1270111111110000000127
−11111111111111110255
−51111101111111010251
−1281000000001111111128

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 calculator

Invert 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 converter

Overflow 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:

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

  1. 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.
  2. Use the matching FlashKit page linked above. Consent checkboxes on network tools are required before the request leaves the browser.
  3. Copy or download the result from this tab. FlashKit does not keep a locker or an account.
  4. Verify the output: validate HTML, preview OG tags, open a PDF, or count characters for a caption limit — whatever the job actually needs.
  5. 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.

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.

Related Tools