By a whisker

Meaning: By a very small amount or very narrowly.

Example: She won the race by a whisker.