A custom is a practice a community shares and expects: "It is the custom here to bring flowers on the first visit." A habit is something one person does automatically, often without thinking and often hard to stop: "He has a habit of tapping his pen." Customs belong to groups and carry expectation; habits belong to individuals and run on autopilot.
The core difference
Two things separate them: who does it and how conscious it is. A custom is collective and deliberate — people know they are doing it and could explain why. A habit is personal and largely automatic — people often do not notice they are doing it at all.
Using "custom"
- Removing your shoes indoors is a custom in many households.
- Local custom requires the eldest to speak first.
- By custom, the outgoing chair proposes their successor.
Custom also has a personal use, but it is formal and implies a chosen, settled practice rather than an unconscious one: It was her custom to walk before breakfast. That sentence describes a decision she keeps; "she had a habit of walking before breakfast" would suggest something more automatic and less dignified.
Using "habit"
- I've got into the habit of checking my phone in bed.
- Biting your nails is a hard habit to break.
- She still says "sorry" out of pure habit.
- He drinks the same coffee every day — force of habit.
Note the collocations, which almost never cross over: you break, kick, form or get into a habit; a custom is observed, followed, upheld or dies out.
The test
Ask: would anyone else notice if you stopped? If a whole community shares the practice and would find it odd or rude if you did not follow it, it is a custom. If only you do it, and stopping would be a matter of self-discipline rather than social offence, it is a habit.
A second cue: if you could put "bad" in front of it, it is a habit. "A bad habit" is idiomatic; "a bad custom" is not something English says.
The traps
Customs (plural) also means the government department that inspects goods at a border, and the duties charged there: We were held up at customs. That sense is unrelated to the singular.
Custom as an adjective means made to order: a custom kitchen, custom software. Do not confuse it with customary, which is the adjective from the practice sense: the customary greeting.
Habit has its own second life: a nun's or monk's garment, and formerly a riding habit. It survives mainly in that religious sense.
Finally, if you want the neutral word for something you do regularly by choice — exercising, journalling — routine or practice is often better than either.