Convert to HTTP-Header-Case
content-type becomes Content-Type, x-request-id becomes X-Request-Id and ACCEPT-LANGUAGE becomes Accept-Language. Each part between hyphens is lowercased and then capitalized, and no hyphen is ever added, removed or moved. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- content-type
- Text
- Content-Type
- Original
- content-type
- Segments
- 2
No dictionary, network request, random choice, or current date can alter the output.
What header case means
Familiar examples include Content-Type, Cache-Control, Accept-Language, and X-Request-Id. The behavior is deliberately narrower than general title case. It does not treat spaces as word separators, consult a list of abbreviations, preserve an all-capital initialism such as ID, or guess that a phrase should acquire new hyphens.
As a result, x-request-id consistently becomes X-Request-Id rather than changing according to a style dictionary. Repeating the operation is safe because already formatted input produces the same formatted output. This makes the result suitable for documentation generators, snapshot tests, data cleanup, and interfaces that need one unambiguous display convention.
How separators, casing, and unusual segments are handled
Hyphens are structural input, so the algorithm preserves them rather than normalizing them. A leading hyphen, trailing hyphen, or repeated pair of hyphens creates an empty segment that remains empty in the output. That choice prevents a formatting helper from silently rewriting identifiers or collapsing information.
Within every non-empty segment, Unicode lowercase conversion runs first, and the first character with distinct upper- and lowercase forms is then capitalized. Digits and punctuation before that character remain where they were, so 2fa-token becomes 2Fa-Token. A segment made entirely of digits or punctuation simply passes through its lowercase operation unchanged.
Spaces are also preserved and are not promoted to separators: this capability expects header-style, hyphen-delimited text and does not turn an ordinary sentence into a field name. A maximum of one hundred thousand characters bounds memory and processing time.
What you can do with it
Clean configuration displays
Format hyphenated header keys for readable dashboards, support exports, audit reports, and legacy administration screens.
FAQ
Does it add hyphens to ordinary phrases?
No. It preserves existing hyphens and changes casing within their segments; it does not replace spaces or invent separators.
Does it keep abbreviations such as ID in capitals?
No. There is no list of abbreviations, so every part follows the same rule and x-request-id becomes X-Request-Id. That keeps the result identical every time instead of depending on a style dictionary.
What happens when a part starts with a digit?
Digits and punctuation stay where they are, and the first letter after them is capitalized. So 2fa-token becomes 2Fa-Token, while a part made only of digits passes through unchanged.
Is it safe to run it on text that is already formatted?
Yes. Formatted input comes back exactly the same, so running the conversion twice never changes the result. That makes it dependable for documentation generators and data cleanup.
What happens to leading or doubled hyphens?
They are kept. A hyphen at the start or end, or two in a row, leaves an empty part that stays empty, so the number and position of the hyphens never change.
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/header-case \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"content-type"}'const res = await fetch("https://api.kit.forhosting.com/str/header-case", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "content-type"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/header-case",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "content-type"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/header-case", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"content-type"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"content-type"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/header-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": "content-type"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.header_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
Convert any header-style text to HTTP-Header-Case with a predictable, repeatable rule: every hyphen-separated segment is lowercased, then its first cased character is capitalized. That turns content-type into Content-Type, x-request-id into X-Request-Id, and ACCEPT-LANGUAGE into Accept-Language without changing the placement or number of hyphens. It runs entirely in the browser for interactive use and uses the identical deterministic logic through the API. Empty or malformed input is rejected clearly instead of becoming a misleading blank result, and each successful API conversion costs $0.002.
What HTTP-Header-Case means
HTTP-Header-Case is a presentation convention in which each part separated by a hyphen begins with a capital letter and the rest of that part is lowercase. This converter applies that rule mechanically to the complete input: it splits on hyphens, lowercases every segment, capitalizes the first cased character in each segment, and joins the segments with the original hyphen structure. The response returns text as the primary converted value, original as an exact echo for auditing, segments as the number of pieces created by splitting on hyphens, and method as a stable identifier for pipelines.
How separators, casing, and unusual segments are handled
The input must be a string and must contain at least one character; missing values, null, arrays, objects, booleans, and an empty string are rejected as invalid_input.
Use it for display and tooling, not protocol validation
The output is formatting only. Interactive conversions are free in the browser. Since both channels share the same pure solve function, moving from a pasted example to a production script does not introduce a second set of casing rules. The converter is most useful at boundaries where people read field names: API documentation, support articles, configuration screens, generated tables, code samples, changelogs, and test reports. It does not verify that the input is a syntactically valid HTTP field name, check whether a header is registered, interpret its value, merge duplicates, or decide whether a custom X- prefix is appropriate. It also does not claim that title-style capitalization is required on the wire. Modern protocols and libraries commonly use lowercase field names, and HTTP field names are case-insensitive in their semantics. Use this capability when you intentionally need the conventional human-readable HTTP-Header-Case spelling, and use a protocol validator or header inspection tool when correctness of an actual request or response is the goal. Automated successful requests cost $0.002; validation failures are not useful conversions and return a typed error.
Integration use cases
Standardize API documentation
Turn inconsistent lowercase or uppercase field labels into a uniform HTTP-Header-Case presentation before publishing reference pages.
Generate deterministic test fixtures
Produce stable expected header labels for snapshots, formatters, importers, and compatibility tests without duplicating casing logic.
Technical questions
What does this HTTP-Header-Case converter cost?
Interactive conversion is free in your browser. Each successful API request costs $0.002.
Does it preserve abbreviations such as ID or HTTP?
No. The deterministic rule lowercases each complete segment before capitalizing its first cased character, so id becomes Id.
Does the result validate an HTTP header field name?
No. The result is a display-style transformation, not protocol syntax validation or registry lookup.
Are HTTP header field names case-sensitive?
Their semantics are case-insensitive. Use this converter when you want the familiar title-style presentation, not because the protocol requires it.