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
Run — free
Worked example
- Text
- Hello World
- 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.
What you can do with it
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.
FAQ
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.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
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"}'const res = await fetch("https://api.kit.forhosting.com/str/alternating-case", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hello World"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/alternating-case",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hello World"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/alternating-case", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hello World"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hello World"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/alternating-case", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Hello World"
}Example response
{
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
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.
Integration use cases
Deterministic mixed-case fixtures
Generate reproducible alternating strings for unit tests, golden files, and CI assertions on case-handling and parser code.