Is it possible to convert simple numbers and equations to latex form?

For example:

2x+5 becomes: 2x%2B5

2x^2+5 becomes: 2x%5E2%2B5

5sinx/2cosx becomes: 5sinx%2F2cosx

etc…

I need this because I am using an online calculator and I cannot simply enter /2x+5 in the url, I need to enter it in that form

Any advice?

Thanks