---
title: "Convert numbers between hexadecimal, binary, decimal, and octal bases. Accepts any base as input (prefix 0x for hex, 0b for binary, 0o for octal, or plain decimal) and returns all four representations simultaneously. Also reports bit width, byte count, ASCII character (if printable), and signed interpretations (8-bit, 16-bit, 32-bit two's complement). Essential for embedded programming, register debugging, network protocol analysis, and color code conversion. Example: 0xFF → decimal 255, binary 0b11111111, octal 0o377, 8 bits, 1 byte."
method: POST
path: "/api/hex_converter"
tags: ["general"]
---

# Convert numbers between hexadecimal, binary, decimal, and octal bases. Accepts any base as input (prefix 0x for hex, 0b for binary, 0o for octal, or plain decimal) and returns all four representations simultaneously. Also reports bit width, byte count, ASCII character (if printable), and signed interpretations (8-bit, 16-bit, 32-bit two's complement). Essential for embedded programming, register debugging, network protocol analysis, and color code conversion. Example: 0xFF → decimal 255, binary 0b11111111, octal 0o377, 8 bits, 1 byte.

`POST /api/hex_converter`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/hex_converter`
- Auth: none declared

## Request body

- object
  - `value` string, required: The number to convert. Prefix with 0x for hex (0xFF), 0b for binary (0b1010), 0o for octal (0o17). Plain numbers are treated as decimal. Supports negative values with leading minus.

## Response `200`

Computed result for hex_converter

- object
  - `result` object, required
    - `decimal` number, required: Decimal (base-10) value.
    - `hex` string, required: Hexadecimal string with 0x prefix (e.g. '0xFF').
    - `hex_upper` string, required: Hexadecimal with uppercase letters (e.g. '0xFF').
    - `binary` string, required: Binary string with 0b prefix (e.g. '0b11111111').
    - `octal` string, required: Octal string with 0o prefix (e.g. '0o377').
    - `bits` number, required: Minimum number of bits needed to represent this value (unsigned).
    - `bytes` number, required: Minimum number of bytes needed (ceil(bits/8)).
    - `ascii` string, nullable, required: ASCII character if the value is a printable character (32-126), null otherwise.
    - `signed_8` number, nullable, required: Signed 8-bit interpretation (-128 to 127), null if out of range.
    - `signed_16` number, nullable, required: Signed 16-bit interpretation (-32768 to 32767), null if out of range.
    - `signed_32` number, nullable, required: Signed 32-bit interpretation, null if out of range.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
