同じ means 'the same.' It is irregular: it behaves like a na-adjective but drops な when placed directly before a noun.
[A] と [B] は同じです | 同じ + [Noun] (no な, no の)
私のカバンは田中さんのと同じです。
Watashi no kaban wa Tanaka-san no to onaji desu.
My bag is the same as Tanaka's.
私のカバン (my bag) は + 田中さんの (Tanaka's [bag]) と (as/with) + 同じです (is the same)
私たちは同じ学校に行っています。
Watashitachi wa onaji gakkou ni itte imasu.
We go to the same school.
同じ + 学校 (school) — attaches directly, no particle between them
彼と私は同じ大学の学生です。
Kare to watashi wa onaji daigaku no gakusei desu.
He and I are students at the same university.
同じ + 大学 (university) — 同じ attaches directly to the noun, with no な
• The missing な: The key rule. Even though 同じ acts like a na-adjective, it drops な (and never takes の) before a noun. Say 同じ学校, never 同じな学校 or 同じの学校. • The 'as/with' particle: To compare A to B, Japanese says 'A is the same WITH B' using と (AとBは同じ). Do not use に or を.
The JLPT rarely asks whether you recognise a pattern — it asks which of several similar patterns fits. These are the ones 同じ is tested against.
同じ is a na-type word ('same'), while 違う is a verb ('to differ'). So you say AとBは同じです but AとBは違います (not 違いです).
Study Japanese grammar on LenGaki

Get the Android app
The app adds offline study, home-screen widgets, stroke-order tracing, speaking practice with pronunciation scoring, and an AI tutor that answers questions in context — none of which fits in a browser tab.