Math & Number Utilities100% Client-Side

Convert Decimal to Binary

Paste a base-10 integer to see the bits that represent its magnitude. The converter prints zeroes and ones with a minus sign for negative values. It keeps large integers exact within its supported range. Use the result to compare values in an exercise or to prepare a bit string for a fixture, then add formatting separately if it requires an explicit width or prefix.

Input
2 chars•1 lines
Output

Reverse tool

Binary to Decimal Converter

Convert a signed binary integer to decimal. Paste a bit string with optional leading zeroes or a 0b prefix and read its exact base-10 value.

Open Binary to Decimal Converter
Example input
101010
Example output
42

How to Use the Decimal to Binary Converter Online

  1. 1Paste one whole number written in base 10. Check that its digits belong to that base.
  2. 2Use 0 through 9 for the source magnitude, with an explicit sign when your integer is negative.
  3. 3Read the equivalent binary digits and check any minus sign before copying the result into a fixture.
  4. 4Record both bases with the example. Add any field width, prefix, or spacing separately when the destination requires a particular display.

Input & Output Examples

The result represents the same integer, 42 in base ten, written in base 2.

Input Sample
42
Expected Output
101010

A magnitude of 1024 is a one followed by ten zeroes. The leading minus sign is preserved.

Input Sample
-1_024
Expected Output
-10000000000

Practical Developer Workflows

  • Check which bit positions describe a decimal value in an exercise.
  • Generate the binary spelling of a fixture integer without rounding.
  • Compare positive and negative examples to see how the sign is displayed.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The powers of two 32, 8, and 2 add to 42. Mark those positions as ones and the intervening positions as zeroes. The resulting binary string is 101010.

Explore Other Tools

12 suggested tools

View all tools