Square charges a flat 2.75% as of this post, so let's say someone wants to pay you $100 but you don't want to be the one to take the hit for using a credit card. How do you arrive at the correct value for the surcharge?
You could add 2.75% to arrive at $102.75, but then when Square takes their cut you only get $99.92. You lost 8¢! That's because 2.75% of $102.75 is more than $2.75. So let's get our maths in a row and fix it!
We're looking for the value x such that x-x*2.75%=y where y is the amount you want to end up with. Simplify that using algebra and you get x*97.25%=y or rather x=y*1/97.25% or x=y*102.8277635%. For you folks without a % on your calculator that's x=y*1.028277635.
The generalized solution for finding what you should surcharge, compared to what you are being surcharged is x=1/(1-y)-1.
In the $100 range we can drop some of those extra digits to arrive at a surcharge of 2.83%. Since we rounded up this keeps you safe in the $1,000 range too.
Of cource it's easier to calculate a surcharge of 3%, but that makes you a bit of a jerk. On the other hand you could take the 8¢ hit and call it even, or go down to 2% and share the cost more evenly.