> １２時 **までに** 帰らなければなりません。  
>  I must go home before 12.
>
> 寝る **前に** 本を読みます。  
>  Before I sleep, I read a book.
CC BY-SA 4.0
2022-01-15T10:35:22.557
92973
2022-01-16T03:36:19.060
2022-01-16T03:36:19.060
9831
48518
question
word-choice
What is the difference between までに and 前に
までに basically means "by" and it's used to mark a deadline. 12時までに～します means
you may do it at 11:30 or even at 7:00. On the other hand, 12時前に～します means you
do it (shortly) before 12:00, for example at 11:45, but usually not at 7:00.

寝る前に本を読みます is a natural sentence that simply describes what the speaker does
_at night_ , before sleeping. 寝るまでに本を読みます implies there is a deadline, so this
sounds like the speaker must read the book before sleeping, at the latest, but
he can read it _during the day_ if he wants.
CC BY-SA 4.0
2022-01-16T02:18:29.017
92982
2022-01-16T02:18:29.017
5010
92973
answer
To summarize the comments and provide an answer, these are not the same.

までに is a particle meaning "by". Thus:

暗いまでに帰らないと

"I have to be back by dark"

前に is a combination of 前 (before) and the time indicator に, thus "before":

食べる前にいつも手を洗っている

"I always wash my hands before eating"

They might sometimes be similar, for instance, you could write the first
sentence as:

暗い前に帰らないと "I have to get home before it's dark"

Which has a slightly different meaning. However, in general, they are not
interchangeable. The following sentence is strange:

食べるまでにいつも手を洗っている
CC BY-SA 4.0
2022-01-16T02:18:36.253
92983
2022-01-16T02:18:36.253
48969
92973
answer
## までに

までに is the combination of particles まで and に. The first particle specifies the
ending point in time (deadline), while the latter specifies the point in time
where the event will take place, which may or may not coincide with the
deadline. If it doesn't coincide, it happens before the deadline.

Let's look at an example:

> 5時 **までに** メールします。
>

>> I will email it **by** 5 o'clock

_By_ means **not later than** , so the email can be sent **at or before 5
o'clock**. The same applies for までに, hence the translation.

Let's say that the email was sent at 4 o'clock, as in the following
illustration:

[![img1](https://i.stack.imgur.com/09xVi.png)](https://i.stack.imgur.com/09xVi.png)

[source](https://ar.pinterest.com/pin/638314947163762689/)

The red dot represents the time at which the event took place and _5:00_ the
deadline. This means that the red dot is given by に and _5:00_ by まで. Overall,
the action took place at 5時までに.

> 4時 **に** メールしました。
>

>> I emailed it **at** 4 o'clock.

> 5時 **まで** は、4時 **に** メールしました。(unnatural)
>

>> **Until** 5 o'clock, I emailed it **at** 4.

> 5時 **までに** メールしました。(natural)
>

>> I emailed it **by** 5 o'clock.

**Collocations**

までに follows nouns and verbs in the dictionary form.

> 今週の終わりまでに•••
>

>> By the end of this week...

> 彼女が来るまでに•••
>

>> By the time she comes...

終わり is noun being modified by 今週 and the resulting noun phrase, 今週の終わり
precedes までに. 来る, a verb in the dictionary form, precedes it too.

12時 is a noun phrase, like in your example.

## 前に

前に is the combination of the noun 前 and the particle に. 前, when talking about
time, means **before**. に simply marks the time especified by 前.

> 晩ご飯を食べ **る** 前に山田さんに電話をしました。
>

>> Before eating dinner, I called Ms. Yamada.

Note that the modifying verb is always in the dictionary form.

## までに VS 前に

AまでにB can either mean that B takes places **at or before** A. It's usually
used to mark deadlines, so it has that nuance.

A前にB can only mean that B takes place **before** A.
CC BY-SA 4.0
2022-01-16T02:59:28.023
92984
2022-01-16T03:06:34.177
2022-01-16T03:06:34.177
45630
45630
92973
answer