How many PWMs can Arduino Mega 2560 manage ?

Officialy Arduino Mega 2560 has 14 hardware pwm, but it can manage 48 Servos, so it is using software pwm or how did they do that?

I need to manage 36 pwm of 500Hz in normal duty cycles from 0% to 100%. Would this be possible?

I want to control 36 mosfets for one-direction dc motors.

Try the library: SoftPWM. I don't know how customizable this library is, but it can make more pins than the dedicated PWM ones into PWM pins.

Don't forget flyback diodes. No diodes will kill N Channel mosfets pretty fast. This is because of the inductive nature of magnetic motors.

So softpwm is not built-in into arduino library?

forgoden:
So softpwm is not built-in into arduino library?

No.

Go to include libraries.
Select library manager.
Search for "softpwm".
Click install.
You now have this library.

You can go to examples and see example codes for the library.

Servos don't really use PWM. They use a 1 (full turn one direction) to 2mS (full turn the other direction) wide pulse that occurs every 20mS (50Hz rate).
That narrow of a pulse would not likely get a stopped motor turning. A turning motor would likely stop before that narrow as the motor slowed down from a 50% duty cycle (1/2 speed).

CrossRoads:
Servos don't really use PWM. They use a 1 (full turn one direction) to 2mS (full turn the other direction) wide pulse that occurs every 20mS (50Hz rate).
That narrow of a pulse would not likely get a stopped motor turning. A turning motor would likely stop before that narrow as the motor slowed down from a 50% duty cycle (1/2 speed).

So, does this mean, managing 36 pwms like 50% or other percent duty cycles would not work fine as servo managing? Or should I just try softpwm ?

In description: GitHub - bhagman/SoftPWM: A Wiring (and Arduino) Library to produce PWM signals on arbitrary pins. I see it use only Timer2 and it is only up to 20 channels.

And I am just wondering, because ATMega2560 have more timers, so it could be more channels ?