POST/v1/convert/text-hex1 credit / call
Text <-> hex
Convert text to a hex byte sequence, or decode a hex byte sequence back to text.
| Parameter | Type | Required | Description |
|---|
| text | string | Yes | mode=encode: plain text. mode=decode: hex string. |
| mode | string | No | encode | decode. Default: encode. |
| separator | string | No | Separator between hex bytes when encoding. Default: . |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/text-hex \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"text":"hi"}'
Response
{
"ok": true,
"data": {
"result": "68 69"
}
}
POST/v1/convert/text-codepoints1 credit / call
Text <-> Unicode code points
Convert text to space-separated Unicode code points (U+XXXX), or decode them back to text.
| Parameter | Type | Required | Description |
|---|
| text | string | Yes | mode=encode: plain text. mode=decode: code points. |
| mode | string | No | encode | decode. Default: encode. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/text-codepoints \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"text":"hi"}'
Response
{
"ok": true,
"data": {
"result": "U+0068 U+0069"
}
}
POST/v1/convert/base1 credit / call
Number base converter
Convert an arbitrary-size integer written in any base (2-36) into binary, octal, decimal and hex.
| Parameter | Type | Required | Description |
|---|
| value | string | Yes | The number to convert, as a string. |
| fromBase | number | No | Source base (2-36). Default: 10. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/base \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"value":"255","fromBase":10}'
Response
{
"ok": true,
"data": {
"binary": "11111111",
"octal": "377",
"decimal": "255",
"hex": "ff"
}
}
POST/v1/convert/roman-numeral1 credit / call
Roman numeral converter
Convert a whole number (1-3999) to a Roman numeral, or a Roman numeral back to a number.
| Parameter | Type | Required | Description |
|---|
| value | string | Yes | mode=encode: whole number. mode=decode: Roman numeral. |
| mode | string | No | encode | decode. Default: encode. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/roman-numeral \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"value":"1994"}'
Response
{
"ok": true,
"data": {
"result": "MCMXCIV"
}
}
POST/v1/convert/unit1 credit / call
Unit converter
Convert a value between units within a category (length, weight, temperature, area, volume, speed, time, digital-storage, data-rate, pressure, energy, power, angle, fuel-economy, frequency), returning every unit in that category.
| Parameter | Type | Required | Description |
|---|
| category | string | Yes | Category id: length, weight, temperature, area, volume, speed, time, digital-storage, data-rate, pressure, energy, power, angle, fuel-economy, frequency. |
| value | number | Yes | Value to convert. |
| from | string | Yes | Source unit id. |
| to | string | Yes | Target unit id. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/unit \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"category":"length","value":1,"from":"mi","to":"km"}'
Response
{
"ok": true,
"data": {
"result": 1.609344
}
}
POST/v1/convert/cooking1 credit / call
Cooking measurement converter
Convert a cooking amount between volume and/or mass units using an ingredient's density. Results are approximate.
| Parameter | Type | Required | Description |
|---|
| ingredient | string | Yes | Ingredient id: water, milk, flour, sugar, brown-sugar, butter, oil, honey, salt, rice, cocoa. |
| value | number | Yes | Amount to convert. |
| from | string | Yes | Source unit id (cup, tbsp, tsp, floz, ml, l, g, kg, oz, lb). |
| to | string | Yes | Target unit id. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/cooking \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"ingredient":"flour","value":1,"from":"cup","to":"g"}'
Response
{
"ok": true,
"data": {
"result": 125.15
}
}
POST/v1/color/convert1 credit / call
Color format converter
Convert a HEX color, rgb() value or CSS color name into HEX, RGB, HSL, HSV and CMYK.
| Parameter | Type | Required | Description |
|---|
| color | string | Yes | HEX color, rgb() value or CSS color name. |
Request
curl -X POST https://toolsonduty.com/api/v1/color/convert \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"color":"#ff0000"}'
Response
{
"ok": true,
"data": {
"hex": "#ff0000",
"rgb": "rgb(255, 0, 0)",
"hsl": "hsl(0, 100%, 50%)"
}
}
POST/v1/color/name-to-hex1 credit / call
CSS color name to HEX
Look up the HEX value for one of the 147 standard CSS color names.
| Parameter | Type | Required | Description |
|---|
| name | string | Yes | CSS color name, e.g. "cornflowerblue". |
Request
curl -X POST https://toolsonduty.com/api/v1/color/name-to-hex \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"name":"cornflowerblue"}'
Response
{
"ok": true,
"data": {
"hex": "#6495ed"
}
}
POST/v1/color/nearest-name1 credit / call
Nearest CSS color name
Find the closest of the 147 standard CSS color names to a HEX value, by RGB distance.
| Parameter | Type | Required | Description |
|---|
| hex | string | Yes | HEX color, e.g. #6495ed. |
Request
curl -X POST https://toolsonduty.com/api/v1/color/nearest-name \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"hex":"#6495ed"}'
Response
{
"ok": true,
"data": {
"name": "cornflowerblue",
"exact": true
}
}
POST/v1/convert/number-words1 credit / call
Number <-> words
Spell a number out in English words, or parse English number words back into a number.
| Parameter | Type | Required | Description |
|---|
| text | string | Yes | mode=to-words: a number. mode=to-number: number words. |
| mode | string | No | to-words | to-number. Default: to-words. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/number-words \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"text":"1234","mode":"to-words"}'
Response
{
"ok": true,
"data": {
"result": "One thousand two hundred thirty-four"
}
}
POST/v1/convert/scientific-notation1 credit / call
Scientific notation converter
Convert a number into standard, scientific, e-notation and engineering forms.
| Parameter | Type | Required | Description |
|---|
| value | string | Yes | A number, e.g. 1234 or 1.23e4. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/scientific-notation \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"value":"1234"}'
Response
{
"ok": true,
"data": {
"standard": "1234",
"scientific": "1.234 × 10^3",
"eNotation": "1.234e+3"
}
}
POST/v1/convert/fraction-decimal1 credit / call
Fraction <-> decimal
Convert a terminating decimal to a simplified fraction and mixed number, or a fraction/mixed number to a decimal.
| Parameter | Type | Required | Description |
|---|
| text | string | Yes | mode=to-fraction: a decimal like 0.75. mode=to-decimal: a fraction like 3/4 or 1 1/2. |
| mode | string | No | to-fraction | to-decimal. Default: to-fraction. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/fraction-decimal \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"text":"0.75","mode":"to-fraction"}'
Response
{
"ok": true,
"data": {
"decimal": "0.75",
"fraction": "3/4",
"mixed": "3/4"
}
}
POST/v1/convert/xml-format1 credit / call
XML formatter
Pretty-print (indent) an XML document. Formatting only; does not validate the XML.
| Parameter | Type | Required | Description |
|---|
| xml | string | Yes | XML text to format. |
| indentSize | number | No | Spaces per indent level. Default: 2. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/xml-format \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"xml":"<a><b>1</b></a>"}'
Response
{
"ok": true,
"data": {
"result": "<a>\n<b>1</b>\n</a>"
}
}
POST/v1/convert/date-format1 credit / call
Date format converter
Parse a date (ISO text, common locale strings, or a Unix timestamp) and render it in many common formats, plus an optional custom pattern.
| Parameter | Type | Required | Description |
|---|
| date | string | Yes | A date like 2024-01-31, 01/31/2024, or a Unix timestamp. |
| customPattern | string | No | An optional date-fns format pattern, e.g. "yyyy/MM/dd". |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/date-format \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"date":"2024-01-31"}'
Response
{
"ok": true,
"data": {
"forms": [
{
"label": "ISO date",
"value": "2024-01-31"
}
]
}
}
POST/v1/convert/file-size1 credit / call
File size formatter
Format bytes as readable binary or decimal units.
| Parameter | Type | Required | Description |
|---|
| bytes | number | Yes | Non-negative byte count. |
| decimals | number | No | Decimal places from 0 to 10. Default: 2. |
| binary | boolean | No | Use base-1024 IEC units. Default: true. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/file-size \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"bytes":1536000,"binary":true}'
Response
{
"ok": true,
"data": {
"value": 1.46,
"unit": "MiB",
"formatted": "1.46 MiB"
}
}
POST/v1/convert/punycode1 credit / call
Punycode converter
Encode an internationalized hostname as ASCII or decode xn-- labels to Unicode.
| Parameter | Type | Required | Description |
|---|
| domain | string | Yes | Hostname without protocol or path. |
| mode | string | No | encode | decode. Default: encode. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/punycode \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"domain":"münich.example","mode":"encode"}'
Response
{
"ok": true,
"data": {
"result": "xn--mnich-kva.example"
}
}
POST/v1/convert/unicode-escape1 credit / call
Unicode escape converter
Escape non-ASCII characters as Unicode sequences or restore supported sequences.
| Parameter | Type | Required | Description |
|---|
| text | string | Yes | Text or Unicode escape sequences. |
| mode | string | No | escape | unescape. Default: escape. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/unicode-escape \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"text":"Hi 👋","mode":"escape"}'
Response
{
"ok": true,
"data": {
"result": "Hi \\u{1f44b}"
}
}
POST/v1/convert/html-to-text1 credit / call
HTML to text
Strip HTML markup, scripts and styles while preserving common block breaks.
| Parameter | Type | Required | Description |
|---|
| html | string | Yes | HTML fragment or document. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/html-to-text \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello</h1><p>World</p>"}'
Response
{
"ok": true,
"data": {
"result": "Hello\nWorld"
}
}
POST/v1/convert/latlon-utm1 credit / call
Latitude/longitude to UTM
Convert WGS84 latitude and longitude to UTM zone, hemisphere, easting and northing.
| Parameter | Type | Required | Description |
|---|
| latitude | number | Yes | Latitude from -80 to 84. |
| longitude | number | Yes | Longitude from -180 to 180. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/latlon-utm \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"latitude":28.6139,"longitude":77.209}'
Response
{
"ok": true,
"data": {
"zone": 43,
"hemisphere": "N"
}
}
POST/v1/convert/ring-size1 credit / call
Ring size converter
Convert US ring size, inside diameter or circumference to the nearest standard size.
| Parameter | Type | Required | Description |
|---|
| value | number | Yes | Ring size measurement. |
| system | string | No | us | diameter-mm | circumference-mm. Default: us. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/ring-size \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"value":7,"system":"us"}'
Response
{
"ok": true,
"data": {
"us": 7
}
}
POST/v1/convert/shoe-size1 credit / call
Shoe size converter
Approximately convert adult US men's, US women's, UK, EU and centimeter shoe sizes.
| Parameter | Type | Required | Description |
|---|
| value | number | Yes | Shoe size measurement. |
| system | string | No | us-men | us-women | uk | eu | cm. Default: us-men. |
Request
curl -X POST https://toolsonduty.com/api/v1/convert/shoe-size \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"value":9,"system":"us-men"}'
Response
{
"ok": true,
"data": {
"usMen": 9
}
}