The invention discloses a sizing agent for silicon carbide or silicon nitride fibers. The sizing agent is prepared from, by weight, 0.2-0.8 part of polyvinyl alcohol, 0.1-1.5 parts of modified silicone oil, 0.5-3.5 parts of alkylphenol ethoxylates, 0.1-0.25 part of benzoic acid and 100 parts of deionzied water. The sizing agent for the silicon carbide or silicon nitride fibers is applied to ceramic fibers converted by a polycarbosilane precursor such as second-generation and third-generation continuous silicon carbide fibers, wave-transmitting-type continuous silicon carbide fibers and broadband wave-absorbing continuous silicon carbide fibers, and bonding and bundling of loose cellosilk can be enhanced. Softness of the fibers is facilitated, the friction force of fiber bundles is reduced,and thus the fiber bundles are easier to weave; coverage and repair of defective holes in the surfaces of the fibers are facilitated, and the intensity of the fibers is improved; improvement of the static resistance of the surfaces of the fibers is facilitated, and adsorption of water molecules and dust particles in the atmosphere is reduced.