It might work, depending on the boat and the setup of the trailer.
I personally like a longer trailer.
Gives you room to mount a spare tire, and a tongue jack/dolly.
It also allows you enough room to step over the tongue while it is connected to the tow vehicle.
Also, does you tow vehicle have a tailgate or a rear hatch? If so, a longer trailer will give you clearance to open the tailgate or hatch without hitting the winch post or boat.
My 18' boat sits perfectly on a 21' trailer.