5087 ÷ 2 = 2543 R1
We're going to perform division on 5087 with 2 as the divisor.

Step 1:
2 goes into 5 2 times with a remainder of 1.
Write down 2 as next digit of of the result. 
Result so far: 2
Subtract 4 from 5 to get 1.
Bring next digit (0) of the dividend behind the 1 and repeat the process: 10 / 2

Step 2:
2 goes into 10 5 times with a remainder of 0.
Write down 5 as next digit of of the result. 
Result so far: 25
Subtract 10 from 10 to get 0.
Bring next digit (8) of the dividend behind the 0 and repeat the process: 8 / 2

Step 3:
2 goes into 8 4 times with a remainder of 0.
Write down 4 as next digit of of the result. 
Result so far: 254
Subtract 8 from 8 to get 0.
Bring next digit (7) of the dividend behind the 0 and repeat the process: 7 / 2

Step 4:
2 goes into 7 3 times with a remainder of 1.
Write down 3 as next digit of of the result. 
Result so far: 2543
Subtract 6 from 7 to get 1.

The final result is 2543 with a remainder of 1.