Yatta meaning: yay, I did it!
Yatta (やった) can mean “yay!” or “I did it!” by itself. In a sentence it is also the plain past of yaru, “to do.” Use context to tell them apart.

In short
やった! (yatta) means “Yay!” or “I did it!” as an excited reaction. It can celebrate someone else’s success or good news, too. In an ordinary sentence, やった is the plain past of やる (“to do”), so it can simply mean “did.”
Yellow the idea to rememberBlue Japanese to learn
A friend tells you tomorrow’s picnic is still on. やった! is a happy reaction, even though you did not do anything yourself. In 昨日宿題をやった, the same form just reports that you did your homework.
When yatta means “yay”
やった!チケットが取れた!
普通体 plainYay! I got tickets!
A friend reacts to successfully getting a ticket. The exclamation expresses relief and excitement.
「明日は休みだって。」「やった!」
普通体 plain“Apparently we’re off tomorrow.” “Yay!”
The second speaker is happy about the news. English “I did it” would miss the point here.
In an informal message, やったー! stretches the final vowel to signal excitement. In conversation, it works between friends or in a relaxed group. If a colleague formally tells you they passed a qualification, おめでとうございます directly congratulates them.
When yatta means “did”
もう宿題やった?
普通体 plainDid you do your homework already?
A family member uses a plain-style question. The context supplies the particle and the subject.
うん、夕飯の前にやったよ。
普通体 plainYeah, I did it before dinner.
The object is clear from the question. The past verb says the job is finished.
If you need to report it politely to a teacher, 宿題はもうしました works. The verb する has the plain past した and polite past しました. The Japanese te- and ta-form sheet shows why the ending of やる changes to った.
How to pronounce yatta
Give the small っ a beat: や・っ・た. Close off the sound briefly just before た. Full-sized つ would add the sound tsu, which you do not say here. When the cheer is stretched, the extra sound comes after た.