How To Convert Between Binary, Decimal & Hexadecimal

Binary: base-2 numeric system which uses two digits: 0, 1

Decimal: base-10 numeric system which use ten digits: 0–9

Hexadecimal: base-16 numeric system which uses sixteen digits: 0–9, A-F

Binary → Decimal

As binary is base-2, write powers of 2 (starting from zero) against the binary number and add up the values which have a ‘1’ in their place.

Decimal → Binary

Start from the left hand side and add up powers of 2 until you get to the decimal number.

Hexadecimal → Decimal

Start from the left hand side and add up powers of 16 until you get to the decimal number. In hexadecimal, numbers greater than 9 are represented by letters (i.e. A = 10, B = 11…).

Decimal → Hexadecimal

Start from the left hand side and add up powers of 16 until you get to the decimal number.

Binary → Hexadecimal

Split the 8-bit binary number into two nibbles (cute word for 4 bits), calculate the individual hexadecimal value and place them together.

Hexadecimal → Binary

Calculate the individual binary value for each nibble (4 bits) and place them together.

--

--

--

Tech Enthusiast | Entrepreneur | Music Artist | MEng @ Cambridge

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

8 Top JavaScript Frameworks for Development of Your Project

TOP ECMAScript — ES6 FEATURES EVERY JAVASCRIPT DEVELOPER SHOULD KNOW

How to Build an Embedded Widget with React & Redux

URL Routes and Parameters in FreePascal Web servers

Learn JavaScript from Scratch in 2022 (5.19)

Building A Searchbox UI with Keyboard Shortcuts Support

Learning JavaScript: A Sequenced Approach

Integrating Apollo and Express to build a Node.js GraphQL API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akhil Sonthi

Akhil Sonthi

Tech Enthusiast | Entrepreneur | Music Artist | MEng @ Cambridge

More from Medium

HTML — Header & Paragraph

macOS App, 5. Use NSOutlineView.

Top 6 IoT Applications in 2022

WordPress or Custom Website: How to Choose the Best Web Development Platform