TC

Train-Case Converter — Free Online Tool

Processed locally. No data stored.
0 chars

What is Train-Case Converter?

Train-Case capitalises the first letter of each word and joins them with hyphens, producing output like This-Is-Train-Case. It is best known as the conventional format for HTTP header names (Content-Type, Accept-Encoding, Cache-Control).

The name comes from the visual resemblance to connected train cars. This tool converts any input — plain text, camelCase, snake_case, or kebab-case — into properly capitalised Train-Case output.

When to use Train-Case Converter?

1 header names like Content-Type, Authorization, X-Forwarded-For, and Cache-Control. It is also used in some configuration file formats and API documentation. While HTTP/2 headers are technically lowercase, many tools and documentation still display them in Train-Case for readability.

If you need all-lowercase hyphens, use the Kebab Case Converter. For all-uppercase hyphens, try the COBOL-CASE Converter.

How to use this tool

  1. 1Paste your text
  2. 2Click 'Convert' to get Train-Case
  3. 3Copy for HTTP headers and config keys

The tool detects word boundaries from spaces, underscores, hyphens, and camelCase transitions, capitalises the first letter of each word, and joins them with hyphens.

Examples

InputOutput
hello worldHello-World
content type headerContent-Type-Header
accept encodingAccept-Encoding
x-api-keyX-Api-Key
background_colorBackground-Color

Rules & Behavior

  • The first letter of each word is capitalised, and the remaining letters are lowercase. This produces the characteristic Title-Cased-Hyphenated pattern.
  • Words are joined by hyphens (-). Spaces, underscores, dots, and camelCase boundaries are all replaced with hyphens.
  • This format is also known as Header-Case or Pascal-Kebab-Case, since it combines Pascal-style capitalisation with kebab-style hyphen separators.

Related Tools

Frequently Asked Questions

What is Train-Case?

Train-Case capitalises the first letter of each word and separates words with hyphens, like Content-Type or Accept-Encoding. Each capitalised word visually resembles a train car connected by hyphen 'couplings'. It is the conventional format for HTTP/1.1 header names and some configuration keys.

When is Train-Case used?

HTTP/1.1 headers traditionally use Train-Case: Content-Type, Accept-Encoding, Cache-Control, X-Forwarded-For, Authorization. It appears in some API documentation, configuration files, and technical specifications. While HTTP/2 normalises headers to lowercase, Train-Case remains the standard display format.

Is Train-Case the same as Header-Case?

Yes. Train-Case and Header-Case describe exactly the same convention — capitalised words separated by hyphens. The name you use depends on context: 'Header-Case' emphasises its use in HTTP headers, while 'Train-Case' describes the visual pattern.

How is it different from kebab-case?

kebab-case is all lowercase (hello-world). Train-Case capitalises each word (Hello-World). Both use hyphens as separators. The difference is purely in the letter casing — kebab-case for identifiers like CSS classes and URLs, Train-Case for HTTP headers.

Is Train-Case the same as Pascal-Kebab-Case?

Yes. Pascal-Kebab-Case is a more descriptive name that explains the pattern: Pascal-style capitalisation (first letter of each word uppercase) combined with kebab-style hyphen separators. Train-Case, Header-Case, and Pascal-Kebab-Case all refer to the same convention.