How many words do you need to make a language? According to linguist David Peterson, who’s created languages for both HBO’s epic “Game of Thrones” and the new Syfy series “Defiance,” more is better than less, so the show doesn’t get ahead of you — as he learned the hard way.

“The last line in Season 2 of ‘Game of Thrones,’ they needed to me to translate on deadline,” Peterson recalled. “But I was asleep — so [actor] Iain Glen had to ad-lib the line.”

Fortunately, the series could get around the actor’s attempt at language creation— his character, Jorah, is not a native Dothraki, so it was reasonable to assume he might garble the language a bit.

But Peterson, who holds a master’s degree in linguistics, says creating four of the most popular foreign languages on television — the “Game of Thrones” Valyrian and Dothraki languages and the “Defiance” alien languages Irathient and Castithan— isn’t just making up a few words on a whim.

“All of these languages have evolved over 1,000 years or more,” Peterson said. “You have to start with old language and build it up over time.”

And while the tongues spoken in “GoT” can trace their origins back to the George RR Martin books that the series was based on, the two languages — so far — in “Defiance” are completely Peterson’s creation, which meant developing two languages that viewers wouldn’t confuse.

“The only words coined were the names of the races — there weren’t even character names at the time,” Peterson said.

“So they had to be obviously different so you would be able to tell them apart immediately. That meant starting out as opposite as possible.”

To distinguish the two languages, the Castithan language, used by a deceitful, ghostly-looking race of aliens, is spoken very quickly, while the Irathient language, used by a more transient, violent race, is spoken very slowly.

But Peterson still had to keep the dialogue moving.

“I spread grammatical info across the clause, so if that if you dropped out a word or two, you’d still understand,” Peterson said.

Although he’s fluent in earthbound English and Spanish, Peterson has studied a laundry list of other languages, including German, French, Arabic, American Sign Language and even the invented Esperanto.

But his experience with less-than-human languages first came while growing up watching “Star Trek: The Next Generation,” although it ended up being a disappointing experience, Peterson said. The series dumped the Klingon dialect expert after its first season.

“So all of the Klingon is either made up or improperly used,” Peterson noted. “A lot of the words aren’t even correct.”