Number Base Conversion

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

Get API Key

Descripción general

Casos de uso

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

Funcionalidades

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

Puntos finales de la API

Convert Base

Convert an integer from one number base to another.

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

Parámetros

Nombre Tipo Obligatorio Descripción
from integer Obligatorio Source base (2, 8, 10, or 16)
to integer Obligatorio Target base (2, 8, 10, or 16)
value string Obligatorio The number as a string. Accepts optional prefixes: 0x (hex), 0b (binary), 0o (octal).

Pruébalo

Demostración en vivo
Solicitud

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).

Campos de respuesta

Campo Tipo Descripción
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

Ejemplos de código

# 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"

Respuestas de error

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

Parámetros

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

Pruébalo

Demostración en vivo
Solicitud

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).

Campos de respuesta

Campo Tipo Descripción
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.

Ejemplos de código

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"}]}'

Respuestas de error

validation_failed

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

bad_request

The request body is missing or malformed.

Preguntas frecuentes