[subject] + 只 / 只是 / 不过 / 才 + [predicate] + 而已
而已 goes at the very end of a sentence and makes what came before smaller than it might sound: "only, that's all". An earlier word – 只, 只是, 不过, 仅仅, 才 – usually marks the same limit, and 而已 closes it off.
Said about yourself, it reassures the listener that nothing is wrong.
With a number, it says the amount is small.
而已 is neutral and works in writing as well as speech. 罢了 and 只不过 cover the same ground; 罢了 sounds more casual.
而已 closes the sentence. Nothing follows it, not even 了.