ForHosting KIT · Text & AI

Convert to alternating case

«Hello World» becomes «hElLo WoRlD»: every letter alternates lower then upper, always starting lowercase, while spaces, digits and punctuation stay put and never break the rhythm. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello World
You get
Text
hElLo WoRlD
Original
Hello World
Length
11

This convert-to-alternating-case tool takes a non-empty text string and returns the same characters with successive letters forced into a strict lower-then-upper pattern: Hello World becomes hElLo WoRlD, and ALTERNATING becomes aLtErNaTiNg. The engine is fully deterministic: it walks the string once, never calls the network, never samples randomness, and never depends on the clock. Digits, spaces, and punctuation stay exactly where you put them and do not advance the letter index; only cased letters flip on the lower/upper schedule.

Alternating case conversion forces each successive letter in a string into a fixed lower-then-upper pattern while leaving non-letters untouched. In practice Hello World becomes hElLo WoRlD, a mixed identifier like Order_ID-42 becomes oRdEr_iD-42, and a single word such as alternating becomes aLtErNaTiNg. The transform is not title case, sentence case, random mock case, or a simple invert of whatever case the user typed: the first cased letter is always lowercased, the second uppercased, the third lowercased, and so on, regardless of the original case.

Digits, underscores, hyphens, spaces, and other punctuation copy through unchanged and do not consume a letter slot, so the alternating rhythm continues across word boundaries without treating a space as a letter. There is no partial mode that only alternates the first word, no locale override switch in this capacity, and no silent coercion of null into an empty string.

Where alternating case fits in study, publishing, and software

Students meet alternating case when a coding exercise demands a mixed-case transform, when a data-entry lab must prove that parsers accept both lower and upper letters in one token, or when a design class mocks playful social captions without inventing casing by hand. Teachers can pre-generate answer keys that show the expected aLtErNaTiNg form without trusting opaque spreadsheet macros that change locale rules mid-file.

Designers and content teams use alternating case for meme-style mockups, poster drafts that need visual rhythm, and accessibility probes that exercise screen readers and fonts under uneven capitalization. Support and operations teams paste noisy ticket subjects into alternating case when a demo needs a distinctive visual pattern that still preserves the original spelling. Pair it with uppercase, camelCase, or encode tools when you are building a small lab of free, deterministic text helpers for forms, CMS prep, and data hygiene.

Meme and mock caption styling

Turn ordinary phrases into aLtErNaTiNg case for social mockups, design drafts, and playful captions without manual letter toggling.

Teaching and coding challenges

Produce stable alternating-case answer keys and sample inputs for classrooms, homework, and programming exercises.

What does the convert-to-alternating-case tool cost?

It is free in your browser on this page.

What happens if I send an empty string?

Empty text is not a valid conversion; provide a non-empty string.

Does the first letter start lower or upper?

The first cased letter is always lowercase, the second uppercase, and so on (for example Hello becomes hElLo).

What about spaces, digits, and punctuation?

Non-letters are left unchanged and do not advance the letter index, so the alternating rhythm continues across words and symbols.

Is the result the same every time for the same input?

Yes. The transform is pure and deterministic: no network, no randomness, and no clock. The same text always yields the same alternating string.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/alternating-case

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/alternating-case \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello World"}'
{
  "text": "Hello World"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.alternating_case",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Empty input is rejected with a clear invalid_input error so a blank form field cannot become a silent empty success.

What alternating case means and what the response contains

This calculator returns four stable fields: text holds the alternating result you will copy or store, original echoes the exact input string so you can audit what was transformed, length reports the character count of the result (which matches the original length for ordinary BMP text), and method is the fixed tag to_alternating_case for logs and multi-tool pipelines. The engine either builds a complete alternating string inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, objects and arrays that are not plain text, and any payload longer than the documented maximum character count.

How the text field is read and how the result stays reproducible

The value must be a non-empty string; finite numbers and bigints are stringified first so a bare product code typed as a number still converts cleanly after conversion to decimal digits. Letter detection uses the standard JavaScript check that lowercasing and uppercasing a character produce different results, then applies toLowerCase or toUpperCase according to the running letter index—no network dictionary, no machine-learning model, and no date-dependent exceptions. The preferred field is text, but aliases input, string, value, content, and s are accepted so query strings, spreadsheets, and typed forms can reuse the same contract without renaming columns. Booleans, plain objects, and arrays are rejected with a clear message so a mistaken JSON body does not become the word true or an unhelpful object dump. Empty string is always invalid_input: the product promise is convert text, not invent a blank success. Length is capped at one hundred thousand characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. Pair the free browser run on this page with the priced API when you need the identical alternating result inside an automated pipeline without shipping your own string helpers.

Where alternating case fits in study, publishing, and software

On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the string result.

Deterministic mixed-case fixtures

Generate reproducible alternating strings for unit tests, golden files, and CI assertions on case-handling and parser code.

Read the full KIT documentation →