HEX2DEC Function in Excel: Hexadecimal to Decimal

⏱ 1 min readUpdated 28 September 2026

EngineeringLevel: IntermediateAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Related functions

HEX2DEC reads hex text — colour codes, error codes from logs — as a number.

Syntax

=HEX2DEC(number)
Argument What it means
number Up to 10 hex characters.

Examples

Example 1

=HEX2DEC(MID(A2,2,2))

Red channel from a colour like #FF8000 (255).

DEC2HEX · DECIMAL

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong