と marks the thing you compare with. B と同じ says that A and B are the same thing or the same kind. B と同じくらい adds くらい (about) and compares the degree of a quality: A is at about the same level as B. B と違う says that A and B are not the same. You can also put both nouns first: A と B は同じです / A と B は違います.
§1Structure
A は + noun B + と同じだ / と同じです (A is the same as B). Noun B + と同じ + noun (同じ comes directly before the noun, with no な or の). A は + noun B + と同じくらい + い-adjective / な-adjective / verb (A is about as ... as B). The opposite is A は + noun B + と違う / と違います (A is different from B).
§2Examples
わたしのかばんはリンさんのと同じです。
わたしのかばんはリンさんのとおなじです。
My bag is the same as Linh's.
田中さんと同じ料理を注文しました。
たなかさんとおなじりょうりをちゅうもんしました。
I ordered the same dish as Mr. Tanaka.
弟は父と同じくらい背が高いです。
おとうとはちちとおなじくらいせがたかいです。
My younger brother is about as tall as my father.
地下鉄はバスと同じくらい便利だ。
ちかてつはバスとおなじくらいべんりだ。
The subway is about as convenient as the bus.
わたしの国の習慣は日本と違います。
わたしのくにのしゅうかんはにほんとちがいます。
The customs of my country are different from Japan's.
このカメラは前のと同じじゃありません。新しいモデルです。
このカメラはまえのとおなじじゃありません。あたらしいモデルです。
This camera is not the same as the previous one. It's a new model.
あなたの辞書もこれと同じですか。
あなたのじしょもこれとおなじですか。
Is your dictionary the same as this one too?
子どものころ、兄と同じ学校に通っていた。
こどものころ、あにとおなじがっこうにかよっていた。
When I was a child, I went to the same school as my older brother.
§3Common mistakes
- Adding な or の between 同じ and a noun. 同じ is special: it goes directly before the noun. 同じな本 and 同じの本 are wrong. Say 同じ本.
- Using the wrong particle for the thing you compare with. わたしの意見は田中さんに同じです and 日本に違います are wrong. Both 同じ and 違う take と: 田中さんと同じです / 日本と違います.
- Using と同じくらい + negative to say 'not as ... as'. 弟は父と同じくらい背が高くない does not mean 'my brother is not as tall as my father'. For that meaning, use ほど〜ない: 弟は父ほど背が高くない.
§4How it's different from similar grammar
- ほど〜ない (not as ... as)
- と同じくらい puts two things at about the same level in an affirmative sentence: 大阪は東京と同じくらいにぎやかです (Osaka is about as lively as Tokyo). ほど〜ない says the topic does not reach the other's level, and the sentence is negative: わたしの町は東京ほどにぎやかじゃありません (My town is not as lively as Tokyo).
- のような / のように (like, similar to)
- と同じ means the two things are really the same: 姉と同じ会社で働いています (I work at the same company as my sister). のような / のように only says that one thing resembles another, or gives an example: 姉のような人になりたいです (I want to become a person like my sister). The speaker and the sister are similar, not the same person.
§5How this shows up on the JLPT
N4 particle questions often ask for と before 同じ or 違う, with に, を and が as wrong choices. Sentence-ordering questions test the block 'B と + 同じ + noun', where nothing comes between 同じ and the noun. In reading and listening, と同じくらい tells you that two prices, sizes or times are nearly equal, while ほど〜ない tells you they are not, so these two are often placed close together to check your understanding.
§6Quick check (3 questions)
1. Choose the particle that fits the blank: わたしは姉__同じ大学で勉強しています。
わたしはあね__おなじだいがくでべんきょうしています。
2. Which statement is true according to this sentence? 今年の冬は去年と同じくらい寒いです。
ことしのふゆはきょねんとおなじくらいさむいです。
3. Which sentence correctly says 'I bought the same shoes as my friend'?