Textutils API

All basic text manipulation tools available via URL endpoints.

🚀 Getting Started

Each function is accessed via its own endpoint:

GET https://textutils.onrender.com/FUNCTION?text=INPUT

Each request returns a JSON response like this:

{
  "input": "The original input to 'text' parameter",
  // Other applicable parameters (length, etc...)
  "result": "The transformed output",
}

Example

Request

GET https://textutils.onrender.com/uppercase?text=hello world

Response

{
    "input": "hello world",
    "result": "HELLO WORLD"
}

All functions take the parameter text as input.

And some functions require extra parameters.


Available Functions

Text Case

  • lowercase: convert all text to lowercase
  • uppercase: convert all text to uppercase
  • capitalize: capitalize the first character
  • titlecase: capitalize every word

Text Format

  • camelcase: convert to camelCase
  • snakecase: convert to snake_case
  • kebabcase: convert to kebab-case
  • slugify: create a URL-friendly string
  • strip-html: remove HTML tags
  • abbreviate: shorten long text using ellipsis
  • normalize-whitespace: replace multiple spaces with a single space
  • remove-extra-spaces: remove extra spaces between words

Length & Trim

  • trim: remove surrounding whitespace
  • truncate: cut to a maximum length (Extra parameters: length)
  • repeat: repeat the string N times (Extra parameters: times)

Search & Replace

  • contains: check if substring is present (Extra parameters: substring)
  • replace: swap one string with another (Extra parameters: search and replacement)
  • concat: concatenate two strings (Extra parameters: otherString)
  • substring: extract characters between start and end indexes (Extra parameters: start, end)
  • char-at: get character at specific index (Extra parameter: index)
  • char-code-at: get UTF-16 code of character at index (Extra parameter: index)
  • from-char-code: convert UTF-16 code(s) to string (Extra parameter: code)
  • starts-with: check if string starts with substring (Extra parameter: searchString)
  • ends-with: check if string ends with substring (Extra parameter: searchString)
  • includes: check if substring exists (Extra parameter: searchString)
  • split: split string into array (Extra parameter: separator)
  • pad-start: pad string from the start to a target length (Extra parameter: targetLength, padString)
  • pad-end: pad string from the end to a target length (Extra parameter: targetLength, padString)
  • replace-all: replace all occurrences of substring (Extra parameter: search, replacement)

Count

  • wordcount: number of words
  • sentencecount: number of sentences
  • avg-word-length: average word length
  • charcount: number of characters
  • charcount-no-spaces: character count without spaces

Encoding & Decoding

  • encode-base64: encode text to base64
  • decode-base64: decode from base64
  • encode-uri: URI encode
  • decode-uri: URI decode
  • rot13: apply ROT13 cipher

Validation

  • is-alpha: check if text has only alphabetic characters
  • is-numeric: check if text is numeric
  • is-alphanumeric: check if text is alphanumeric
  • has-emoji: check if string contains emoji

Transform

  • reverse: reverse the string
  • remove-punctuation: strip punctuation
  • add-leading-zeroes: pad the beginning of the string with zeroes until it reaches a total length (Extra parameter: totalLength)
  • remove-leading-zeroes: remove all zeroes from the beginning of the string (unless the string is "0")
  • split-lines: split text into an array of lines using newline characters (\n or \r\n)

Conversion

  • to-binary: convert a decimal number to binary string
  • from-binary: convert a binary string to decimal number
  • to-hex: convert a decimal number to hexadecimal string
  • from-hex: convert a hexadecimal string to decimal number
  • to-octal: convert a decimal number to octal string
  • from-octal: convert an octal string to decimal number
  • bit-length: calculate the number of bits needed to represent a number in binary
  • string-to-hex: convert a string to its hexadecimal representation
  • hex-to-string: convert a hexadecimal-encoded string back to plain text
  • ascii-codes: convert each character in the input string to its ASCII code