Auto-detects nearly a dozen input formats and converts them to macro case (all caps + underscores) in one click. Keep your code tidy.
In real-world projects, constants, preprocessor macros, and environment variables often end up as a jumble of snake_case, camelCase, kebab-case, or plain lowercase. Macro case (all caps + underscores, like MAX_SIZE or API_KEY) is the de facto standard for these items – but manually normalising everything is tedious. This tool does it for you in seconds, so your codebase stays consistent without the headache.
Legacy codebases are notorious for mixing styles: max_size, maxSize, MAX-SIZE – you name it. In C/C++ land, macro definitions really must be in macro case to avoid name collisions. Our converter lets you standardise every constant and macro definition in one go, cutting out manual errors and review time.
Microservices often mix Java, Python, Go, and shell scripts. To keep configuration keys and environment variables (e.g., DATABASE_URL) consistent across the stack, teams settle on macro case. This tool lets you take field names from API docs or YAML configs and instantly turn them into the same macro style – no more debate over casing.
It recognises Ada, Camel, Cobol, Dot, Kebab, Lower, Macro, Pascal, Sentence, Snake, Title, Train, and Upper – just pick or let auto‑detect do the guesswork. Paste user_profile_data, userProfileData, UserProfileData, or even USER_PROFILE_DATA, hit Convert, and out pops proper macro case (e.g., USER_PROFILE_DATA).
The textarea accepts multiple lines – paste a whole list of variable names, and each line is converted independently. The output is read‑only to prevent accidental edits, and the “Copy Result” button (powered by clipboard.js) copies everything straight to your clipboard for pasting into your code or docs.
Hit Ctrl+Enter for a quick conversion. The “Clear” button empties both input and output, so you can start fresh immediately.
Macro case is a naming convention where every letter is uppercase and words are separated by underscores (_). It originated from C/C++ preprocessor macros and has since become the go‑to style for constants, enum values, environment variables, and config keys – think MAX_BUFFER_SIZE or DEFAULT_TIMEOUT. The all‑caps visual cue instantly tells you “this is a constant, don’t mess with it”.
In C/C++, macros are text‑substituted at preprocessing time; using lowercase or camelCase risks clashing with variables or functions. Uppercase + underscores is a strong visual marker that distinguishes constants from mutable state. This pattern has been adopted by most languages and even operating systems (e.g., PATH, HOME) – it’s practically a universal idiom.
Unlike snake_case (lowercase with underscores), macro case screams “read‑only”. Unlike camelCase, it eliminates any case‑sensitivity issues – a lifesaver in case‑insensitive environments. Java’s own code conventions recommend macro case for public static final fields (e.g., MAX_SIZE = 100), so it’s not just for C folks.
_ only, e.g., USER_NAME.VERSION_2, but avoid starting with a digit.USER__NAME is a no‑go.Almost every #define in C/C++ uses macro case – e.g., #define PI 3.14159, #define MAX(a,b) ((a)>(b)?(a):(b)). This keeps macros visually distinct from functions and variables.
Java, C#, and even Python (by convention) use macro case for constants: public static final String DEFAULT_ENCODING = "UTF-8";. Enum values like RED, GREEN, BLUE also follow the same style.
System environment variables (PATH, JAVA_HOME) and many config keys (DATABASE_URL, LOG_LEVEL) are naturally macro case because they’re case‑sensitive in shells and easy to spot in configuration files.
MAX_RETRY_COUNT is far better than cryptic MRC.Macro case is one of the oldest and most respected naming conventions in programming. Its all‑caps, underscore‑separated form gives constants, macros, and env vars a clear identity. Master it, and your code will look more professional and be easier to maintain. If you’re staring at a pile of inconsistent names, give our Macro Case Converter a spin – one click, and everything falls into place.