Short influenza postexposure prophylaxis (PEP) showed high efficacy in adults, but studies in children are lacking. This randomized open-label pilot trial aimed to verify noninferiority of a 3- versus 7-day prophylaxis with oral oseltamivir in hospitalized children. Influenza contacts were randomized to the 3- or 7-day group and efficacy, relative risk of adverse events (AEs), and the cumulative costs of drugs and AEs management were compared. The intention-to-treat (ITT) analysis included 59 children (n = 28 and n = 31 in the 3- and 7-day group, respectively). The efficacy was 100% (95% CI 87.7–100%) versus 93.6% (95% CI 78.6–99.2%) in the 3- and 7-day group; the differences were statistically insignificant. A per-protocol (PP) analysis including 56 patients (n = 27 and n = 29, respectively) showed 100% (95% CI 87.2–100%) and 93.1% (95% CI 77.2–99.2%) efficacy, respectively, without statistical significance. Differences were within the predefined noninferiority margin with an efficacy difference Δ = 6.45 percentage points (p.p.) with 1-sided 95% CI (− 2.8, − 1.31, p = 0.86; ITT) and Δ = 6.9 p.p. (1-sided 95% CI − 2.83, − 1.27, p = 0.85; PP). Adverse events did not differ significantly, while the cumulative costs of the prophylaxis and AEs management were higher in the 7-day group (median 10.5 euro vs. 4.5 euro, p < 0.01). This pilot study showed the noninferiority of the 3-day versus 7-day PEP, which was associated with lower costs.Trial registration number: NCT04297462, 5th March 2020, restrospectively registered.