Hacker News new | ask | show | jobs
by OJFord 2243 days ago
You should eschew both and say 'accidentally'.

I do hear 'by accident' but always (as a native speaker of British English, born and living in England) consider it an error.

I have at least heard of 'on accident' too, but interestingly it barely registers on Google's ngram viewer, even with 'American English' selected:

https://books.google.com/ngrams/graph?content=accidentally%2...