It's $15 to be able to write programs for the platform, but you can export them to html5 to make available for others to play online for free. There's a pretty large library of such games hosted on pico-8's website.
There are some open-source alternatives like TIC-80 and PixelVision8. Personally, I'd only recommend them over pico-8 if $15 is a serious barrier or open source is an absolute must. They all have their various strengths and weaknesses, but pico-8 seems to be the best optimized for pure, unadulterated fun.