{"uid":"cap_jVpJMwvaeI9JQni6hP24g","slug":"duo-data-utilities-radix-base-converter-453c73bd","name":"Duo Data Utilities – Radix/Base Converter","description":"Convert an integer between any two numeric bases from 2 to 36, with arbitrary precision so values far beyond 2^53 are exact. Accepts an optional sign and common prefixes (0x, 0b, 0o), validates every digit against the source base, and returns the value in the target base, in decimal, and as its bit length and digit count.","url":"https://api.duoleads.com/v1/num/radix?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["value"],"properties":{"to":{"type":"string","default":"10","pattern":"^[+-]?\\d+$","maxLength":64,"description":"Target base 2-36, default 10."},"case":{"enum":["lower","upper"],"type":"string","default":"lower","maxLength":64,"description":"Digit case for bases above 10: lower (default) or upper."},"from":{"type":"string","default":"auto","maxLength":8,"description":"Source base 2-36, or auto (default) to read a 0x/0b/0o prefix."},"value":{"type":"string","maxLength":1024,"description":"Integer to convert; optional sign and 0x/0b/0o prefix."},"prefix":{"enum":["true","false"],"type":"string","default":"false","maxLength":64,"description":"Emit 0x/0b/0o where conventional. Default false."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","route","version","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"object","required":["result","decimal","from","to","negative","digits","bit_length","exact"],"properties":{"to":{"type":"integer"},"from":{"type":"integer"},"exact":{"type":"boolean"},"digits":{"type":"integer"},"result":{"type":"string"},"decimal":{"type":"string"},"negative":{"type":"boolean"},"bit_length":{"type":"integer"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/num/radix"},"version":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"to":10,"from":16,"exact":true,"digits":10,"result":"3735928559","decimal":"3735928559","negative":false,"bit_length":32},"meta":{"price_usd":"0.05","disclaimer":"Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms","request_id":"01K6B7Q4ZC8H3F2M9WXR5TYN0D","computed_at":"2026-09-28T12:00:00.000Z","deterministic":true},"route":"/v1/num/radix","version":"1.0.0"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7bmCyvm_FT7vqmSNNSSrV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts an integer from any numeric base (2–36) to any other base with arbitrary precision, returning the result, decimal value, bit length, and digit count.","exampleAgentPrompt":"Convert the hex number 0xDEADBEEF to binary for me, showing the result in uppercase digits.","exampleUseCases":[{"title":"Hex to binary for bitfield analysis","prompt":"Take the hex value 0x1A3F and convert it to binary so I can see which bits are set."},{"title":"Large integer base conversion for crypto tooling","prompt":"I have this huge decimal number 123456789012345678901234567890 — convert it to base 16 and tell me how many bits it is."},{"title":"Base 36 short code to decimal lookup","prompt":"Convert this base-36 encoded ID 'Z4K2X' to decimal so I can use it as a numeric key in my database."}],"resultDescription":"A JSON object containing: the converted value in the target base (`result`), the decimal representation (`decimal`), the source base (`from`), the target base (`to`), bit length (`bit_length`), digit count (`digits`), whether the value is negative (`negative`), and an `exact` flag confirming arbitrary-precision accuracy. Also includes metadata: request ID, computation timestamp, price, and a disclaimer.","failureModes":["Invalid digit for the specified source base — returns an error indicating which character failed validation","Source or target base out of range (must be 2–36) — returns a validation error","Value string exceeds maximum length of 1024 characters","Unrecognized prefix when using auto-detect mode — returns a parsing error","Missing required `value` query parameter — returns a 400-level error"],"whenToPreferThis":"Choose this endpoint when you need exact, arbitrary-precision base conversion beyond JavaScript's 2^53 integer limit, support for any base from 2 to 36, prefix auto-detection (0x, 0b, 0o), and validated digit checking. Prefer it over client-side parseInt/toString when dealing with large integers, cryptographic values, or when you need bit-length metadata alongside the conversion result.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T02:52:57.025Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-radix-base-converter-453c73bd"}