Pig Latin Translator (Fun)
Type or paste English text below, see it translated to Pig Latin instantly, with punctuation and capitalization preserved.
About the Pig Latin Translator
The classic rules apply here: a word starting with a vowel just gets "way" tacked on (apple becomes appleway), while a word starting with a consonant cluster moves that cluster to the end and adds "ay" (pig becomes igpay, string becomes ingstray). Capital letters and any punctuation stuck to the end of a word are carried through the translation.
It's built for fun and games, not linguistic accuracy, so hyphenated words, acronyms, or words with no vowels at all might come out looking a little strange.
Contractions translate as one word, not two broken halves
The regex driving word detection, /[a-zA-Z]+(?:'[a-zA-Z]+)*/g, matches a run of letters and lets it continue through an apostrophe into more letters, so "don't" is captured whole rather than being split at the apostrophe. That's a deliberate fix for a real failure mode: a simpler word-boundary based match treats the apostrophe itself as a break, which sends "don" through the translator as one word and the leftover "t" through as a second, tiny, nonsensical one β producing the garbled "onday'tay" instead of the correct "on'tday". Matching the whole contraction as a single unit before translating avoids that entirely.
Punctuation survives because of how JavaScript's replace() works, not extra stripping logic
The About text above says punctuation is "carried through," and it is, but not for the reason you might expect. String.replace() with a global regex only ever touches the substrings it actually matches, leaving every character outside those matches completely untouched in place. Since the word-matching regex only ever captures letters and internal apostrophes, a comma, period, or quotation mark sitting next to a word is simply never part of what gets replaced β it's not stripped and reattached by the translator, it just never leaves its original position in the sentence.
A word with no vowels at all gets "ay" appended whole
The rule for moving a leading consonant cluster only works if there's a vowel somewhere in the word to move that cluster in front of. For a word like "why," where none of the letters are in the set the code checks (a, e, i, o, u β this implementation never treats y as a vowel, in any position), the leading-consonant match consumes the entire word, leaving nothing behind to place in front of it. The fallback for that case is to just tack "ay" onto the whole word unchanged, so "why" becomes "whyay" rather than producing an empty or broken result.
Capitalization moves with the syllable, not the original letter
The translator checks whether a word's first letter was uppercase before lowercasing everything to work with, then reapplies that capitalization to whatever letter ends up at the front of the newly-rearranged word. That's why "String" becomes "Ingstray" with a capital I, not "ingstrAy" or some other position β the capital effectively travels to the front of the result the same way a person translating Pig Latin by hand would naturally recapitalize the new first letter of a proper noun or sentence-starting word.
A quick way to trace the rule by hand
For any consonant-starting word, the process is: find the run of consonants before the first vowel, cut it off the front, move it to the very end, then add "ay." "Chair" starts with the consonant cluster "ch," leaving "air," so the result is "air" + "ch" + "ay" = "airchay." "Smile" starts with "sm," leaving "ile," giving "ilesmay." A word that already starts with a vowel skips the cluster-moving step entirely and just gets "way" appended directly, which is why "apple" becomes "appleway" rather than something involving a rearranged cluster β there's no leading consonant to move in the first place, since the very first character already satisfies the vowel test.
Why a text tool exists for a schoolyard word game at all
Pig Latin has no real connection to the Latin language β the name is a playful, slightly mocking label attached to what's really an English wordplay game, one of a broad family of similar "language games" that shift or encode words using a consistent, learnable rule rather than a random cipher. It's stuck around for generations mostly as something kids teach each other rather than something formally taught, which is part of why the exact rules vary a little from person to person β this tool implements the version most commonly agreed on, covering the vowel and consonant-cluster cases that make up the vast majority of everyday words.
Frequently Asked Questions
Why don't contractions like "don't" or "isn't" break apart weirdly?
The word-matching pattern specifically allows a run of letters to continue through an internal apostrophe, so a contraction is captured and translated as a single word. Without that, a plain word-boundary match would treat the apostrophe as a break and translate the letters on each side separately, producing a nonsensical result.
How is punctuation like commas and periods preserved?
Indirectly. The translator only replaces the letter runs it matches and leaves everything else in the original text exactly where it was, so punctuation isn't specially detected and reattached β it simply was never touched in the first place.
What happens to a word with no vowels, like "why"?
Since there's no vowel to move the leading consonants in front of, the whole word is left as-is with just "ay" added to the end, turning "why" into "whyay." Note that this translator treats y strictly as a consonant, never as a vowel, in any position.
Does capitalization stay on the original letter after translation?
No, it moves to the front of the newly rearranged word. A capitalized word like "String" becomes "Ingstray," with the capital letter following the syllable that ends up first, matching how someone translating Pig Latin by hand would naturally capitalize the result.
Is this a linguistically accurate implementation of Pig Latin?
It follows the most common, generally recognized rule set, but Pig Latin as a language game has no single official standard and different speakers apply slightly different rules, especially around consonant clusters, y, and words with unusual letter patterns. This tool is built for fun rather than as a definitive reference.