The piano keyboard can be confusing to look at for guitar players. So, let's try and make it simpler-ish.
Also, if you you're not familiar with what a musical half step is (i.e. 1/2 step), think the short & scary lick from the movie Jaws that tells us the shark is close by :)
To the left is a bunch of keys on the piano keyboard (or a single octave, from C to C.)
We can think of this as an ergonomic layout of the piano keys, which kind of means: this layout is a relatively comfortable arrangement of the piano keys, which hopefully causes as little strain as possible on the human hands when playing.
Here is an example of an ergonomic computer keyboard.
Both of these tools have very different uses, but are both setup to limit the negative physical impact on the human hands that may be using either one of these tools for hours upon hours each day.
In contrast to the ergonomic computer keyboard above, here are two commonly used regular computer keyboards, one for PC users and other got Mac users.
You'll notice the non-ergonomic arrangement for these two as being very similar to each other.
Okay.... stay with me here :)
Here are the piano keys above laid out in a non-ergonomic arrangement -- so, notice the black keys are the same size as the white keys on this one, which creates even spacing between the keys (versus the smaller & shorter black keys of the normal piano keyboard.)
If this is confusing -- compare the pattern of black keys on the normal piano keyboard to this one; for example the pattern of 2 blacks separated/surrounded by white keys, and then the pattern of 3 black keys separated/surrounded by white keys.
Back to the original piano layout. But this time we have labels pointing out the 1/2 steps between keys.
So the space between every piano key, whether black or white, is a half step (again, think the short scary lick from the movie Jaws :)
Here is the non-ergonomic piano keyboard again, but with the added 1/2 step labels.
On this version, we can see that the half steps represented by keys that are all the same size.
(So...... the black keys on the normal piano keyboard are smaller and shorter for easier playability for our hands = ergonomic piano keyboard!)
So let's compare the non-ergomonic piano keboard to the guitar fretboard:
The 1/2 steps of the non-ergonomic keyboard is lined up with guitar's frets.
So, just as the space between each key on this piano is 1/2 step, the space between each fret is also 1/2 step
The actual notes here do not line up -- as this is only showing how individual piano keys compare to individual frets in terms of musical spacing.
1 fret = 1 piano key (doesn't matter if it's black or white :)
Here we add the 1/2 step labels to the same keyboard & fretboard images.
(Again, the actual notes here do not line up.)
So that is how a 1/2 step is represented on both the guitar fretboard and piano keyboard.
In terms of Western tonality, a 1/2 step is the smallest interval that is available to us, and larger intervals can be counted by the number of 1/2 steps they contain.
For example:
1 half step = 1/2 step; i.e. C to C#
2 half steps = 1 whole step; i.e. C to D
3 half steps = a Minor 3rd; i.e. C to Eb
4 half steps = a Major 3rd; i.e. C to E
etc.