X は、Y と 違う/同じ

違う is a verb and 同じ is a nominal adjective. Thus, they conjugate differently. For instance, consider the following:

違う(違います)
  • 違う
  • 違わない
  • 違った
  • 違わなかった
同じだ(同じです)
  • 同じ
  • 同じじゃない
  • 同じだった
  • 同じじゃなかった

Note that the ways they modify nouns are also different:

(eg.)

There are two ways to express differences/sameness between X and Y.

'X is different from/same as Y'

The important thing to be noted here is that in Japanese, 違う and 同じ both take the particle と. The following lists more examples with 違う and 同じ.

Another way to express differences/sameness between two items is to say, 'X and Y are different/the same'. Thus, the above sentences can be paraphrased as follows: