Home Tools Blog About

Convert Number to Negadecimal

In short

Convert numbers to negadecimal (base -10) and back. BigInt for arbitrary precision. Step-by-step derivation. Free, offline, client-side.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up

Convert decimal integers to negadecimal (base −10) and back, with a full step-by-step derivation panel and place-value verification. Generalized to any negative base from −2 (negabinary) to −16. Uses BigInt internally - no precision loss for arbitrarily large numbers.

Negadecimal Result -

Step-by-Step Division

Each row shows one division step: q = n ÷ base (truncated toward zero). When the remainder is negative, add |base| and bump q by 1.

Place-Value Verification

Multiplying each digit by its place value sums back to the original decimal.

Same Number, Other Negative Bases

Enter a value to convert.
🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Convert Number to Negadecimal

  1. Pick direction. Decimal → Negative-base (default) converts a normal integer to the chosen negative base. Negative-base → Decimal reverses it.
  2. Pick base. Default −10 (negadecimal). Other options range from −2 (negabinary) to −16 (negahexadecimal). All use digits 0..|base|−1; bases beyond −10 use letters A-F like normal hex.
  3. Type your number. Decimal supports any positive or negative integer of arbitrary length (uses BigInt). The default −15 demonstrates the classic case: it converts to 25 in negadecimal.
  4. Read the step-by-step panel. Each row shows the current n, the truncated quotient q, the raw remainder, whether adjustment was needed (when raw remainder is negative, add 10 and bump q), and the digit emitted.
  5. Check the place-value sum. The verification panel decomposes the result as d₂×(base)² + d₁×(base)¹ + d₀×(base)⁰ and computes the sum - it should match your input decimal.
  6. Compare across bases. The cross-base table renders your number in every negative base from −2 to −16 simultaneously, so you can see how representations vary.
  7. Copy, download, or swap. Copy puts the full multi-section report on your clipboard. Download saves as a .txt. Swap toggles direction and pre-fills the previous result as the new input - useful for round-trip verification.

Frequently Asked Questions

Why use negadecimal at all?

Negadecimal eliminates the need for a sign bit/symbol. Every integer – positive or negative – gets a unique representation using only digits 0-9. Compare: in standard decimal, you need -15 (two characters) or a sign bit; in negadecimal, just 25. This property is studied in number theory and used as a teaching example for how positional notation works in non-standard bases. It’s also the basis for how some early Soviet computers (Setun’s negabinary cousin) avoided dedicated sign handling.

How does the conversion algorithm work?

Standard remainder/quotient division, but with one twist. Compute q = n ÷ base (truncated toward zero) and r = n mod base. If r is negative, add |base| to it and increment q by 1. Push r as the next least-significant digit. Repeat with n := q until q = 0. The step panel shows every iteration.

Why is the BigInt support important?

JavaScript’s regular Number type loses integer precision above 2^53 (about 9 quadrillion). For number-theory work involving large integers, that’s not nearly enough. This tool uses native BigInt throughout, so an input like 1234567890123456789012345678901234567890 converts exactly.

What’s the place-value verification for?

It’s the safety net. If the converter outputs 195 for input 15, the verification shows: 1×(−10)² + 9×(−10)¹ + 5×(−10)⁰ = 100 − 90 + 5 = 15. The total must match your input – if not, something’s wrong. This both teaches the math and proves the conversion was correct.

What’s negabinary and how is it related?

Negabinary is base −2 – same idea but with digits 0 and 1 only. So 5 in negabinary is 101 (4 + 0 + 1) and −5 is 111 (4 − 2 + 1, wait that’s 3 not −5… actually -5 in negabinary is 1111: −8 + 4 − 2 + 1 = −5). It’s used in some computer architectures because you can do arithmetic without a separate sign bit. Try base −2 in the selector to see.

Do positive numbers always have an even-length representation, and negative numbers odd?

Yes – that’s the giveaway. In negadecimal, 0 through 9 are 1 digit (representing 0-9 positive), but to express −1 you need 19 (2 digits, because 1×−10 + 9 = −1). The parity of the digit count tells you the sign – positive numbers end up with odd length (or are zero), negative numbers with even length, after dropping the leading zero. Useful as a sanity check.

Can I convert a negadecimal number back to decimal?

Yes – switch direction to “Negative-base → Decimal” or click Swap ⇄. The reverse parser multiplies each digit by its place value (base)^position and sums. The place-value table on the right shows exactly how that decomposition works.

What happens with negative input to a negative base?

Negadecimal of a negative decimal still uses only 0-9 digits – no leading minus sign. Negative input to the input field still works in decimal mode (e.g., -1525); in negative-base mode the parser accepts an explicit leading - as a sign on the parsed magnitude, then negates the result. That’s slightly redundant for negadecimal but matches user expectations.

Is my data uploaded?

No. All BigInt arithmetic runs in your browser using vanilla JavaScript. Open DevTools → Network and confirm zero requests fire after the page loads – even when you Convert. Safe for math research, contest problems, or proprietary algorithm tests.

Does it work offline?

Yes. Total bundle is under 20 KB. Once loaded, disconnect from the internet and keep converting – useful when working through a number-theory textbook or during competitive programming practice.

Keep going

Related Tools

All Number tools →

Calculate Number Divisors

Calculate Number Divisors and Find all divisors of any positive integer, instantly. Free, offline,…

Calculate Number Product

Calculate Number Product - Multiply any list of numbers, instantly. Free, offline, client-side -…

Calculate Number Sum

Calculate Number Sum Add any list of numbers, instantly. Free, offline, client-side - with…

Change Number Base

Convert integers between bases 2-36 (binary, octal, decimal, hex). Arbitrary precision via BigInt. Free,…

Check Number Palindrome

Check whether a number is a palindrome in strict or digits-only mode, with nearest…

Convert Number to Power of Ten

Convert any number to scientific, engineering notation, and metric prefix. Power-of-10 ranges, BigInt-exact powers.…

Convert Number to Power of Two

Find nearest power of 2, binary form, bit width, IEC prefix (Ki/Mi/Gi/Ti). BigInt up…

Create Number Palindrome

Create palindromes from any number - 5 modes including mirror, reverse-and-add (196 problem), next/previous…

Number to Words Converter

Convert a number into English words, handling negatives and decimals.

Random Number Generator - Pick a Number

Generate random numbers with custom range and count. Free tool.

Add Commas to Integer Online - Number Formatting

Add thousands separators (commas) to integers instantly. Support for negative numbers, large integers, batch…

Fraction Addition Calculator

Add two or more fractions with automatic simplification. See exact results and decimal values.…

Share

Embed this tool

Add this free tool to your website. Copy and paste the code: