Number Base Conversion

Convert integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).

Get API Key

Vue d'ensemble

Cas d'utilisation

  • Developer tools and calculators
  • Converting memory addresses or CPU flags between hex and binary
  • Teaching or learning number systems
  • Debugging low-level protocol data

Fonctionnalités

Supports binary, octal, decimal, and hexadecimal
Accepts optional base prefixes (0x, 0b, 0o)
Supports negative integers
Fast, in-memory only — no database required

Points de terminaison de l'API

Convert Base

Convert an integer from one number base to another.

GET
https://requiems.xyz/v1/technology/base

Paramètres

Nom Type Requis Description
from integer Requis Source base (2, 8, 10, or 16)
to integer Requis Target base (2, 8, 10, or 16)
value string Requis The number as a string. Accepts optional prefixes: 0x (hex), 0b (binary), 0o (octal).

Essayez-le

Démo en direct
Requête

Source base (2, 8, 10, or 16)

Target base (2, 8, 10, or 16)

The number as a string. Accepts optional prefixes: 0x (hex), 0b (binary), 0o (octal).

Champs de réponse

Champ Type Description
input string The original value as provided in the request
from integer The source base
to integer The target base
result string The converted value in the target base

Exemples de code

# Decimal to hex
curl "https://requiems.xyz/v1/technology/base?from=10&to=16&value=255" \
  -H "requiems-api-key: YOUR_API_KEY"

# Hex to binary (using 0x prefix)
curl "https://requiems.xyz/v1/technology/base?from=16&to=2&value=0xff" \
  -H "requiems-api-key: YOUR_API_KEY"

Réponses d'erreur

bad_request

A required parameter is missing, the base is not one of 2/8/10/16, or value is not valid for the given base.

Batch Convert Base

Convert up to 50 numbers between bases in a single request. Results are returned in input order. Per-item errors are reported inline.

POST
https://requiems.xyz/v1/technology/base/batch

Paramètres

Nom Type Requis Description
items array<object> Requis List of conversion requests (1–50 items).
items[].from integer Requis Source base (2, 8, 10, or 16).
items[].to integer Requis Target base (2, 8, 10, or 16).
items[].value string Requis The number as a string. Accepts optional prefixes: 0x (hex), 0b (binary), 0o (octal).

Essayez-le

Démo en direct
Requête

List of conversion requests (1–50 items).

Source base (2, 8, 10, or 16).

Target base (2, 8, 10, or 16).

The number as a string. Accepts optional prefixes: 0x (hex), 0b (binary), 0o (octal).

Champs de réponse

Champ Type Description
results array<object> Per-item results in input order.
results[].from integer The source base used for conversion.
results[].to integer The target base used for conversion.
results[].input string The original value as provided in the request.
results[].result string The converted value in the target base (omitted on error).
results[].error string Error message if this item failed (omitted on success).
total integer Total number of items processed.

Exemples de code

curl -X POST https://requiems.xyz/v1/technology/base/batch \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"from": 10, "to": 16, "value": "255"}, {"from": 2, "to": 10, "value": "1111"}]}'

Réponses d'erreur

validation_failed

The items array is missing, empty, or exceeds 50 items.

bad_request

The request body is missing or malformed.

Foire aux questions