A まえに B means 'before A, B'. B is the action that happens first, and A happens later. The tense of the whole sentence is shown only at the end of the sentence, so the verb before まえに does not change. With a length of time, 〜まえに means '... ago'.
§1Structure
Verb dictionary form + まえに (寝るまえに). Noun + の + まえに (食事のまえに). Length of time + まえに, with no の (3年まえに = three years ago). The verb before まえに stays in the dictionary form even when the sentence is about the past. If the まえに part has its own subject, mark it with が (父が帰るまえに).
§2Examples
寝るまえに、日記を書きます。
ねるまえに、にっきをかきます。
I write in my diary before I go to bed.
日本へ来るまえに、国で日本語を勉強しました。
にほんへくるまえに、くにでにほんごをべんきょうしました。
Before I came to Japan, I studied Japanese in my country.
食事のまえに、手を洗ってください。
しょくじのまえに、てをあらってください。
Please wash your hands before the meal.
テストのまえに、あまり勉強しませんでした。
テストのまえに、あまりべんきょうしませんでした。
I didn't study much before the test.
旅行に行くまえに、何を買いますか。
りょこうにいくまえに、なにをかいますか。
What will you buy before you go on the trip?
兄は3年まえに結婚しました。
あにはさんねんまえにけっこんしました。
My older brother got married three years ago.
毎朝、会社へ行くまえに、コーヒーを飲む。
まいあさ、かいしゃへいくまえに、コーヒーをのむ。
Every morning I drink coffee before I go to the office. (plain style)
帰るまえに、いっしょにお茶を飲まない?
かえるまえに、いっしょにおちゃをのまない?
Shall we have some tea together before we go home? (casual)
§3Common mistakes
- Using the た-form before まえに because the sentence is about the past. ✗ 日本へ来たまえに、日本語を勉強しました。 The verb before まえに is always the dictionary form: ○ 日本へ来るまえに、日本語を勉強しました。 The past is shown only by 勉強しました at the end.
- Getting の wrong. A noun takes の before まえに: ○ 食事のまえに, ○ 授業のまえに. But a length of time does not take の when you mean '... ago': ✗ 3年のまえに結婚しました → ○ 3年まえに結婚しました.
- Putting the two actions in the wrong order. In A まえに B, the action you do first is B, not A. If you wash your hands first and then eat, say ○ ごはんを食べるまえに、手を洗います. ✗ 手を洗うまえに、ごはんを食べます means you eat first and wash your hands later.
§4How it's different from similar grammar
- 〜たあとで (after doing)
- まえに and あとで are a pair, but the verb form is different. Before まえに, use the dictionary form: 食べるまえに、手を洗います (I wash my hands before I eat). Before あとで, use the た-form: 食べたあとで、歯をみがきます (I brush my teeth after I eat). Neither verb changes with the tense of the sentence. With a noun, both take の: 食事のまえに / 食事のあとで.
- 〜てから (after doing, and then)
- The same two actions can be said with either pattern, but the order of the words is the opposite. 手を洗ってから、食べます puts the first action first: wash, then eat. 食べるまえに、手を洗います puts the later action first: before eating, wash. With てから the first action takes the て-form, and with まえに the later action takes the dictionary form.
§5How this shows up on the JLPT
In the N5 grammar questions, the blank is often the verb right before まえに, and the choices are forms of one verb (行く / 行った / 行って / 行きます). Choose the dictionary form even if the sentence ends in 〜ました. Another common blank is the の in Noun + の + まえに. In sentence-ordering questions, keep 'dictionary form + まえに' or 'noun + の + まえに' together as one block. In reading and listening, まえに and あとで are used to test the order of actions, so check which action really comes first.
§6Quick check (3 questions)
1. Choose the word that fits the blank: テスト__まえに、よく勉強しました。
テスト__まえに、よくべんきょうしました。
2. Which sentence correctly says 'I called my friend before I left home'?
3. 寝るまえに、シャワーを浴びます。 — What does this person do first?
ねるまえに、シャワーをあびます。