工具 指南
text 免费 无需注册

时区转换

即时在大写、小写、首字母大写、驼峰式、帕斯卡式、下划线式和连字符式之间转换文本。

正在加载工具…

关于此工具

将任意文本转换为您需要的大小写格式。支持8种转换模式,包括编程大小写格式(驼峰式、帕斯卡式、下划线式、连字符式)和标准写作格式(大写、小写、首字母大写、句首大写)。适用于编码、SEO和内容写作。

使用方法

  1. 1 在输入框中粘贴或输入您的文本。
  2. 2 点击任意转换按钮应用该大小写格式。
  3. 3 转换后的文本立即显示在输出框中。
  4. 4 点击复制以复制结果。

What "case" really means in text and code

Letter case is more than an aesthetic choice. In prose, capitalization signals the start of a sentence or a proper noun. In code, the case convention you pick is a hard rule enforced by linters, style guides, and sometimes the language itself: userId and user_id are two different identifiers, and mixing them breaks software. This converter does the tedious re-typing for you, transforming a single block of text into any of ten case styles instantly and entirely inside your browser.

The ten formats and where each belongs

Format"hello world example" becomesTypical use
UPPERCASEHELLO WORLD EXAMPLEHeadings, emphasis, constants in legacy code
lowercasehello world exampleTags, email addresses, normalization
Title CaseHello World ExampleHeadlines, book and article titles
Sentence caseHello world exampleBody copy, UI labels, descriptions
camelCasehelloWorldExampleJavaScript and Java variables, JSON keys
PascalCaseHelloWorldExampleClass and component names
snake_casehello_world_examplePython variables, database columns
kebab-casehello-world-exampleURL slugs, CSS classes, HTML attributes
CONSTANT_CASEHELLO_WORLD_EXAMPLEEnvironment variables, fixed constants
dot.casehello.world.exampleConfig keys, namespaced properties

How the converter splits words — and why that matters

Every transformation starts by breaking your text into words. The clever part is that the tool recognizes boundaries that have no visible separator. It inserts a split between a lowercase letter and an uppercase one (so helloWorld is read as two words), and it handles runs of capitals followed by a capitalized word (so HTMLParser splits into HTML and Parser rather than HTM and LParser). It also treats hyphens, underscores, dots, and spaces as separators. This means you can paste text already in any case and convert it cleanly to another — you are not limited to space-separated input.

A worked example

Paste getHTTPResponseCode and click snake_case. The splitter first sees the lowercase-to-uppercase jump after get, then the capital run HTTP followed by Response, giving the words get, HTTP, Response, Code. Each is lowercased and joined with underscores, producing get_http_response_code. Click kebab-case on the same input and you get get-http-response-code — ideal as a URL slug or CSS class.

Practical use cases

  • Renaming variables across languages. Porting a Python snake_case field into a JavaScript object? Convert to camelCase in one click instead of editing each character.
  • Generating URL slugs. Turn an article title like "10 Tips for Faster Builds" into 10-tips-for-faster-builds with kebab-case.
  • Cleaning up headlines. Title Case fixes inconsistent capitalization when you have copied a heading from a messy source.
  • Building constants. CONSTANT_CASE produces ready-to-paste environment variable names such as DATABASE_CONNECTION_URL.

Things Title Case and Sentence case do not do

Be aware of the limits of any automatic case tool, this one included. Title Case here capitalizes the first letter of every word; it does not apply the editorial rule that small words like "of", "the", and "and" stay lowercase. If you need strict AP or Chicago style, review the output by hand. Sentence case capitalizes the first letter and the first letter after each period, exclamation mark, or question mark — so it will not know that "iPhone" or "NASA" should keep their original capitals. Re-capitalize proper nouns and acronyms after converting.

Common mistakes to avoid

  • Losing acronym casing. Converting parseJSON to Title Case yields "Parse Json", not "Parse JSON". Acronyms get folded to ordinary words because the tool cannot know which letters are an abbreviation.
  • Expecting punctuation to survive. The programming formats (camel, snake, kebab, etc.) strip separators by design. If your text contains meaningful commas or slashes, they will be absorbed as word boundaries.
  • Converting code that relies on exact identifiers. Never bulk-convert a whole source file's case; you will rename keywords and string literals too. Convert individual identifiers only.

Privacy

The conversion runs as plain JavaScript on your device. Your text is never uploaded, logged, or sent to a server — you can disconnect from the internet and every button still works. Use the Swap control to move the output back into the input box and chain conversions, for example lowercase first, then snake_case.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}